home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 July / Macworld (1999-07).dmg / Shareware World / Info / For Developers / Mops 3.4.sea / Mops source / System source / zString+ < prev   
MacBinary  |  1998-07-27  |  16.5 KB  |  [TEXT/MSET]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: zString+

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Mon Jul 27 11:57:43 1998, modified Mon Jul 27 11:57:43 1998, creator 'MSET', type ASCII, 16268 bytes "zString+" , at 0x400c 381 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MSET]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 08 7a 53 74 72 69 6e | 67 2b 00 00 00 00 00 00 |..zStrin|g+......|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 53 45 | 54 01 00 00 00 00 00 00 |.TEXTMSE|T.......|
|00000050| 00 00 00 00 00 3f 8c 00 | 00 01 7d b1 e2 53 f7 b1 |.....?..|..}..S..|
|00000060| e2 53 f7 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |.S......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 48 01 00 00 |........|....H...|
|00000080| 5c 20 53 54 52 49 4e 47 | 2b 20 63 6c 61 73 73 2e |\ STRING|+ class.|
|00000090| 20 20 54 68 69 73 20 61 | 64 64 73 20 6d 61 6e 79 | This a|dds many|
|000000a0| 20 75 73 65 66 75 6c 20 | 6d 65 74 68 6f 64 73 20 | useful |methods |
|000000b0| 74 6f 20 63 6c 61 73 73 | 20 53 74 72 69 6e 67 2e |to class| String.|
|000000c0| 0d 0d 5c 20 4f 72 69 67 | 69 6e 61 6c 20 4d 6f 70 |..\ Orig|inal Mop|
|000000d0| 73 20 76 65 72 73 69 6f | 6e 20 2d 20 4a 75 6e 65 |s versio|n - June|
|000000e0| 20 38 39 2e 0d 0d 5c 20 | 4a 61 6e 20 39 38 09 55 | 89...\ |Jan 98.U|
|000000f0| 70 64 61 74 65 64 20 66 | 6f 72 20 50 6f 77 65 72 |pdated f|or Power|
|00000100| 4d 6f 70 73 2c 20 61 6e | 64 20 53 74 72 69 6e 67 |Mops, an|d String|
|00000110| 55 74 69 6c 69 74 69 65 | 73 20 69 6e 63 6c 75 64 |Utilitie|s includ|
|00000120| 65 64 20 61 67 61 69 6e | 2e 0d 5c 20 46 65 62 20 |ed again|..\ Feb |
|00000130| 39 38 09 46 75 72 74 68 | 65 72 20 64 65 62 75 67 |98.Furth|er debug|
|00000140| 67 65 64 20 62 79 20 4d | 69 63 68 61 65 6c 20 42 |ged by M|ichael B|
|00000150| 61 72 6f 6e 0d 0d 0d 73 | 79 73 63 61 6c 6c 20 54 |aron...s|yscall T|
|00000160| 45 54 65 78 74 42 6f 78 | 0d 0d 0d 09 30 20 20 20 |ETextBox|....0 |
|00000170| 76 61 6c 75 65 09 09 43 | 41 53 45 3f 09 5c 20 54 |value..C|ASE?.\ T|
|00000180| 72 75 65 20 69 66 20 63 | 61 73 65 20 74 6f 20 62 |rue if c|ase to b|
|00000190| 65 20 73 69 67 6e 69 66 | 69 63 61 6e 74 20 69 6e |e signif|icant in|
|000001a0| 20 63 6f 6d 70 61 72 69 | 73 6f 6e 73 0d 0d 20 20 | compari|sons.. |
|000001b0| 24 20 44 20 20 20 63 6f | 6e 73 74 61 6e 74 09 52 |$ D co|nstant.R|
|000001c0| 45 54 09 09 5c 20 43 61 | 72 72 69 61 67 65 20 72 |ET..\ Ca|rriage r|
|000001d0| 65 74 75 72 6e 0d 20 20 | 20 20 30 20 20 20 76 61 |eturn. | 0 va|
|000001e0| 6c 75 65 09 09 24 53 54 | 41 52 54 20 20 5c 20 41 |lue..$ST|ART \ A|
|000001f0| 64 64 72 20 6f 66 20 73 | 74 61 72 74 20 6f 66 20 |ddr of s|tart of |
|00000200| 28 63 68 61 72 73 20 6f | 66 29 20 63 75 72 72 65 |(chars o|f) curre|
|00000210| 6e 74 20 73 74 72 69 6e | 67 2e 0d 0d 0d 5c 09 09 |nt strin|g....\..|
|00000220| 09 09 3d 3d 3d 3d 3d 3d | 3d 3d 20 20 54 52 54 42 |..======|== TRTB|
|00000230| 4c 20 63 6c 61 73 73 20 | 20 3d 3d 3d 3d 3d 3d 3d |L class | =======|
|00000240| 3d 0d 0d 28 2a 0d 54 72 | 61 6e 73 6c 61 74 65 20 |=..(*.Tr|anslate |
|00000250| 74 61 62 6c 65 73 20 61 | 6c 6c 6f 77 20 76 65 72 |tables a|llow ver|
|00000260| 79 20 66 61 73 74 20 73 | 65 61 72 63 68 69 6e 67 |y fast s|earching|
|00000270| 20 6f 66 20 73 74 72 69 | 6e 67 73 20 66 6f 72 20 | of stri|ngs for |
|00000280| 73 70 65 63 69 66 69 65 | 64 20 73 65 74 73 0d 6f |specifie|d sets.o|
|00000290| 66 20 63 68 61 72 61 63 | 74 65 72 73 2e 20 20 49 |f charac|ters. I|
|000002a0| 6e 20 65 66 66 65 63 74 | 20 77 65 20 61 72 65 20 |n effect| we are |
|000002b0| 73 65 70 61 72 61 74 69 | 6e 67 20 74 68 65 20 73 |separati|ng the s|
|000002c0| 70 65 63 69 66 69 63 61 | 74 69 6f 6e 20 6f 66 20 |pecifica|tion of |
|000002d0| 77 68 61 74 20 77 65 0d | 61 72 65 20 73 65 61 72 |what we.|are sear|
|000002e0| 63 68 69 6e 67 20 66 6f | 72 20 66 72 6f 6d 20 74 |ching fo|r from t|
|000002f0| 68 65 20 61 63 74 75 61 | 6c 20 73 65 61 72 63 68 |he actua|l search|
|00000300| 20 6f 70 65 72 61 74 69 | 6f 6e 20 69 74 73 65 6c | operati|on itsel|
|00000310| 66 2e 20 20 54 68 69 73 | 20 61 6c 6c 6f 77 73 20 |f. This| allows |
|00000320| 61 6e 0d 75 6e 63 6c 75 | 74 74 65 72 65 64 20 61 |an.unclu|ttered a|
|00000330| 6e 64 20 65 78 74 72 65 | 6d 65 6c 79 20 66 61 73 |nd extre|mely fas|
|00000340| 74 20 73 65 61 72 63 68 | 20 6f 70 65 72 61 74 69 |t search| operati|
|00000350| 6f 6e 20 28 74 68 65 20 | 53 43 41 4e 3a 20 61 6e |on (the |SCAN: an|
|00000360| 64 20 3c 53 43 41 4e 3a | 20 6d 65 74 68 6f 64 73 |d <SCAN:| methods|
|00000370| 0d 6f 66 20 63 6c 61 73 | 73 20 53 54 52 49 4e 47 |.of clas|s STRING|
|00000380| 2b 29 2c 20 61 6e 64 20 | 69 74 20 61 6c 73 6f 20 |+), and |it also |
|00000390| 61 6c 6c 6f 77 73 20 61 | 20 76 65 72 79 20 66 6c |allows a| very fl|
|000003a0| 65 78 69 62 6c 65 20 28 | 61 6e 64 20 65 61 73 69 |exible (|and easi|
|000003b0| 6c 79 20 65 78 74 65 6e | 73 69 62 6c 65 29 0d 63 |ly exten|sible).c|
|000003c0| 68 6f 69 63 65 20 6f 66 | 20 77 68 61 74 20 74 6f |hoice of| what to|
|000003d0| 20 73 65 61 72 63 68 20 | 66 6f 72 2e 20 20 54 68 | search |for. Th|
|000003e0| 65 20 73 65 74 75 70 20 | 74 69 6d 65 20 66 6f 72 |e setup |time for|
|000003f0| 20 74 72 61 6e 73 6c 61 | 74 65 20 74 61 62 6c 65 | transla|te table|
|00000400| 73 20 63 61 6e 0d 67 65 | 6e 65 72 61 6c 6c 79 20 |s can.ge|nerally |
|00000410| 62 65 20 66 61 63 74 6f | 72 65 64 20 6f 75 74 20 |be facto|red out |
|00000420| 6f 66 20 69 6e 6e 65 72 | 20 6c 6f 6f 70 73 2c 20 |of inner| loops, |
|00000430| 6f 72 20 64 6f 6e 65 20 | 61 74 20 63 6f 6d 70 69 |or done |at compi|
|00000440| 6c 65 20 74 69 6d 65 2c | 20 61 6e 64 20 69 73 0d |le time,| and is.|
|00000450| 71 75 69 74 65 20 66 61 | 73 74 2c 20 61 6e 79 77 |quite fa|st, anyw|
|00000460| 61 79 2e 0d 2a 29 0d 0d | 0d 3a 63 6c 61 73 73 20 |ay..*)..|.:class |
|00000470| 54 52 54 42 4c 20 20 73 | 75 70 65 72 7b 20 6f 62 |TRTBL s|uper{ ob|
|00000480| 6a 65 63 74 20 7d 0d 0d | 72 65 63 6f 72 64 0d 7b |ject }..|record.{|
|00000490| 09 09 75 69 6e 74 09 43 | 4f 55 4e 54 0d 09 32 35 |..uint.C|OUNT..25|
|000004a0| 36 09 62 79 74 65 73 09 | 54 48 45 54 42 4c 0d 7d |6.bytes.|THETBL.}|
|000004b0| 0d 0d 3a 6d 20 54 42 4c | 3a 20 20 69 6e 6c 69 6e |..:m TBL|: inlin|
|000004c0| 65 7b 20 61 64 64 72 3a | 20 74 68 65 54 62 6c 20 |e{ addr:| theTbl |
|000004d0| 7d 20 20 3b 6d 0d 0d 3a | 6d 20 43 4c 45 41 52 3a |} ;m..:|m CLEAR:|
|000004e0| 0d 09 20 63 6c 65 61 72 | 3a 20 63 6f 75 6e 74 0d |.. clear|: count.|
|000004f0| 09 20 61 64 64 72 3a 20 | 74 68 65 54 62 6c 20 20 |. addr: |theTbl |
|00000500| 32 35 36 20 65 72 61 73 | 65 0d 3b 6d 0d 0d 3a 6d |256 eras|e.;m..:m|
|00000510| 20 50 55 54 3a 20 20 7b | 20 61 64 64 72 20 6c 65 | PUT: {| addr le|
|00000520| 6e 20 2d 2d 20 7d 0d 09 | 61 64 64 72 20 20 61 64 |n -- }..|addr ad|
|00000530| 64 72 3a 20 74 68 65 54 | 62 6c 20 20 6c 65 6e 20 |dr: theT|bl len |
|00000540| 32 35 36 20 6d 69 6e 20 | 20 63 6d 6f 76 65 20 20 |256 min | cmove |
|00000550| 3b 6d 0d 0d 3a 6d 20 53 | 45 4c 43 48 41 52 53 3a |;m..:m S|ELCHARS:|
|00000560| 20 20 7b 20 61 64 64 72 | 20 6c 65 6e 20 2d 2d 20 | { addr| len -- |
|00000570| 7d 20 20 20 5c 20 73 65 | 6c 65 63 74 73 20 74 61 |} \ se|lects ta|
|00000580| 62 6c 65 20 62 79 74 65 | 73 20 61 63 63 6f 72 64 |ble byte|s accord|
|00000590| 69 6e 67 20 74 6f 20 74 | 68 65 0d 20 20 20 20 20 |ing to t|he. |
|000005a0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|000005b0| 20 20 20 20 20 20 20 20 | 20 20 20 5c 20 20 63 68 | | \ ch|
|000005c0| 61 72 73 20 69 6e 20 74 | 68 65 20 70 61 73 73 65 |ars in t|he passe|
|000005d0| 64 2d 69 6e 20 73 74 72 | 69 6e 67 2e 0d 09 6c 65 |d-in str|ing...le|
|000005e0| 6e 20 20 70 75 74 3a 20 | 63 6f 75 6e 74 0d 09 42 |n put: |count..B|
|000005f0| 45 47 49 4e 0d 09 09 6c | 65 6e 0d 09 57 48 49 4c |EGIN...l|en..WHIL|
|00000600| 45 0d 09 09 6c 65 6e 0d | 09 09 2d 31 20 2b 2b 3e |E...len.|..-1 ++>|
|00000610| 20 6c 65 6e 0d 09 09 61 | 64 64 72 20 6c 65 6e 20 | len...a|ddr len |
|00000620| 2b 20 63 40 20 20 61 64 | 64 72 3a 20 74 68 65 54 |+ c@ ad|dr: theT|
|00000630| 62 6c 20 2b 20 20 63 21 | 0d 09 52 45 50 45 41 54 |bl + c!|..REPEAT|
|00000640| 0d 3b 6d 0d 0d 3a 6d 20 | 53 45 4c 43 48 41 52 3a |.;m..:m |SELCHAR:|
|00000650| 20 20 7b 20 63 20 2d 2d | 20 7d 20 20 20 20 20 20 | { c --| } |
|00000660| 20 20 20 20 20 5c 20 53 | 65 6c 65 63 74 73 20 74 | \ S|elects t|
|00000670| 68 65 20 67 69 76 65 6e | 20 63 68 61 72 2e 0d 09 |he given| char...|
|00000680| 24 20 66 66 20 61 6e 64 | 3e 20 63 0d 09 31 20 2b |$ ff and|> c..1 +|
|00000690| 3a 20 63 6f 75 6e 74 20 | 20 67 65 74 3a 20 63 6f |: count | get: co|
|000006a0| 75 6e 74 0d 09 61 64 64 | 72 3a 20 74 68 65 54 62 |unt..add|r: theTb|
|000006b0| 6c 20 63 20 2b 20 20 20 | 20 20 20 20 20 5c 20 67 |l c + | \ g|
|000006c0| 65 74 20 6c 6f 63 6e 20 | 6f 66 20 74 61 62 6c 65 |et locn |of table|
|000006d0| 20 62 79 74 65 0d 09 63 | 21 0d 3b 6d 0d 0d 0d 3a | byte..c|!.;m...:|
|000006e0| 6d 20 53 45 4c 43 48 41 | 52 4e 43 3a 20 20 7b 20 |m SELCHA|RNC: { |
|000006f0| 63 20 2d 2d 20 7d 20 20 | 20 20 20 20 20 20 20 5c |c -- } | \|
|00000700| 20 22 53 65 6c 43 68 61 | 72 2c 20 6e 6f 20 63 61 | "SelCha|r, no ca|
|00000710| 73 65 22 2e 0d 09 09 09 | 5c 20 53 65 6c 65 63 74 |se".....|\ Select|
|00000720| 73 20 61 20 63 68 61 72 | 61 63 74 65 72 2c 20 61 |s a char|acter, a|
|00000730| 6e 64 20 69 66 20 69 74 | 20 69 73 20 61 20 6c 65 |nd if it| is a le|
|00000740| 74 74 65 72 2c 0d 09 09 | 09 5c 20 65 6e 74 65 72 |tter,...|.\ enter|
|00000750| 73 20 74 68 65 20 2a 73 | 61 6d 65 2a 20 76 61 6c |s the *s|ame* val|
|00000760| 75 65 20 69 6e 20 74 68 | 65 20 4c 43 20 61 6e 64 |ue in th|e LC and|
|00000770| 20 55 43 20 70 6f 73 69 | 74 69 6f 6e 73 20 6f 66 | UC posi|tions of|
|00000780| 20 74 68 65 0d 09 09 09 | 5c 20 74 61 62 6c 65 2c | the....|\ table,|
|00000790| 20 73 6f 20 74 68 61 74 | 20 63 61 73 65 20 77 69 | so that| case wi|
|000007a0| 6c 6c 20 69 6e 20 65 66 | 66 65 63 74 20 62 65 20 |ll in ef|fect be |
|000007b0| 69 67 6e 6f 72 65 64 20 | 77 68 65 6e 20 74 68 65 |ignored |when the|
|000007c0| 0d 09 09 09 5c 20 74 61 | 62 6c 65 20 69 73 20 75 |....\ ta|ble is u|
|000007d0| 73 65 64 2e 0d 09 63 20 | 73 65 6c 43 68 61 72 3a |sed...c |selChar:|
|000007e0| 20 73 65 6c 66 20 5c 20 | 77 65 20 73 65 6c 65 63 | self \ |we selec|
|000007f0| 74 20 74 68 69 73 20 63 | 68 61 72 2c 20 77 68 61 |t this c|har, wha|
|00000800| 74 65 76 65 72 20 69 74 | 20 69 73 0d 09 63 20 20 |tever it| is..c |
|00000810| 26 20 61 20 20 26 20 7a | 20 20 77 69 74 68 69 6e |& a & z| within|
|00000820| 3f 20 6e 69 70 20 0d 09 | 49 46 09 24 20 44 46 20 |? nip ..|IF.$ DF |
|00000830| 61 6e 64 3e 20 63 20 20 | 5c 20 4c 43 20 6c 65 74 |and> c |\ LC let|
|00000840| 74 65 72 20 2d 3e 20 55 | 43 0d 09 09 2d 31 20 2b |ter -> U|C...-1 +|
|00000850| 3a 20 63 6f 75 6e 74 20 | 20 63 20 73 65 6c 43 68 |: count | c selCh|
|00000860| 61 72 3a 20 73 65 6c 66 | 0d 09 45 4c 53 45 0d 09 |ar: self|..ELSE..|
|00000870| 09 63 20 20 26 20 41 20 | 20 26 20 5a 20 20 77 69 |.c & A | & Z wi|
|00000880| 74 68 69 6e 3f 0d 09 09 | 49 46 09 09 24 20 32 30 |thin?...|IF..$ 20|
|00000890| 20 2b 20 20 2d 31 20 2b | 3a 20 63 6f 75 6e 74 20 | + -1 +|: count |
|000008a0| 20 73 65 6c 43 68 61 72 | 3a 20 73 65 6c 66 0d 09 | selChar|: self..|
|000008b0| 09 45 4c 53 45 09 64 72 | 6f 70 0d 20 20 20 20 20 |.ELSE.dr|op. |
|000008c0| 20 20 20 54 48 45 4e 0d | 09 54 48 45 4e 0d 3b 6d | THEN.|.THEN.;m|
|000008d0| 0d 0d 0d 3a 6d 20 53 45 | 4c 52 41 4e 47 45 3a 20 |...:m SE|LRANGE: |
|000008e0| 20 7b 20 6c 6f 20 68 69 | 20 5c 20 63 6e 74 20 61 | { lo hi| \ cnt a|
|000008f0| 64 64 72 20 2d 2d 20 7d | 0d 09 24 20 66 66 20 61 |ddr -- }|..$ ff a|
|00000900| 6e 64 3e 20 68 69 20 20 | 24 20 66 66 20 61 6e 64 |nd> hi |$ ff and|
|00000910| 3e 20 6c 6f 09 09 09 5c | 20 6a 75 73 74 20 74 6f |> lo...\| just to|
|00000920| 20 62 65 20 6f 6e 20 74 | 68 65 20 73 61 66 65 20 | be on t|he safe |
|00000930| 73 69 64 65 0d 09 68 69 | 20 6c 6f 20 2d 20 31 2b |side..hi| lo - 1+|
|00000940| 20 20 2d 3e 20 63 6e 74 | 20 20 63 6e 74 20 30 3c | -> cnt| cnt 0<|
|00000950| 3d 20 20 3f 45 58 49 54 | 0d 09 61 64 64 72 3a 20 |= ?EXIT|..addr: |
|00000960| 74 68 65 54 62 6c 20 20 | 6c 6f 20 2b 20 20 2d 3e |theTbl |lo + ->|
|00000970| 20 61 64 64 72 0d 09 63 | 6e 74 20 46 4f 52 20 20 | addr..c|nt FOR |
|00000980| 31 20 20 61 64 64 72 20 | 63 21 20 20 31 20 2b 2b |1 addr |c! 1 ++|
|00000990| 3e 20 61 64 64 72 20 20 | 4e 45 58 54 0d 3b 6d 0d |> addr |NEXT.;m.|
|000009a0| 0d 3a 6d 20 49 4e 56 45 | 52 54 3a 20 20 7b 20 5c |.:m INVE|RT: { \|
|000009b0| 20 61 64 64 72 20 2d 2d | 20 7d 0d 09 61 64 64 72 | addr --| }..addr|
|000009c0| 3a 20 74 68 65 54 62 6c | 20 20 2d 3e 20 61 64 64 |: theTbl| -> add|
|000009d0| 72 0d 09 32 35 36 20 46 | 4f 52 0d 09 09 61 64 64 |r..256 F|OR...add|
|000009e0| 72 20 63 40 20 49 46 20 | 20 30 20 20 45 4c 53 45 |r c@ IF | 0 ELSE|
|000009f0| 20 20 2d 31 20 20 54 48 | 45 4e 20 20 61 64 64 72 | -1 TH|EN addr|
|00000a00| 20 63 21 0d 09 09 31 20 | 2b 2b 3e 20 61 64 64 72 | c!...1 |++> addr|
|00000a10| 0d 09 4e 45 58 54 0d 3b | 6d 0d 0d 3a 6d 20 3e 55 |..NEXT.;|m..:m >U|
|00000a20| 43 3a 0d 09 61 64 64 72 | 3a 20 74 68 65 54 62 6c |C:..addr|: theTbl|
|00000a30| 20 20 26 20 41 20 20 2b | 0d 09 61 64 64 72 3a 20 | & A +|..addr: |
|00000a40| 74 68 65 54 62 6c 20 20 | 26 20 61 20 20 2b 0d 09 |theTbl |& a +..|
|00000a50| 32 36 20 20 63 6d 6f 76 | 65 20 20 3b 6d 0d 0d 3a |26 cmov|e ;m..:|
|00000a60| 6d 20 54 52 41 4e 53 43 | 3a 20 20 20 20 20 20 5c |m TRANSC|: \|
|00000a70| 20 28 20 63 20 2d 2d 20 | 63 27 20 29 20 20 54 72 | ( c -- |c' ) Tr|
|00000a80| 61 6e 73 6c 61 74 65 73 | 20 31 20 63 68 61 72 20 |anslates| 1 char |
|00000a90| 75 73 69 6e 67 20 74 68 | 65 20 74 61 62 6c 65 2e |using th|e table.|
|00000aa0| 0d 09 69 6e 6c 69 6e 65 | 7b 20 61 64 64 72 3a 20 |..inline|{ addr: |
|00000ab0| 74 68 65 54 62 6c 20 2b | 20 63 40 20 7d 20 20 3b |theTbl +| c@ } ;|
|00000ac0| 6d 0d 0d 3b 63 6c 61 73 | 73 0d 0d 0d 74 72 54 62 |m..;clas|s...trTb|
|00000ad0| 6c 20 20 75 63 54 62 6c | 0d 0d 6d 61 72 6b 65 72 |l ucTbl|..marker|
|00000ae0| 20 6d 5f 5f 78 78 0d 0d | 3a 20 58 58 0d 20 20 20 | m__xx..|: XX. |
|00000af0| 20 20 20 20 20 30 20 20 | 20 74 62 6c 3a 20 55 43 | 0 | tbl: UC|
|00000b00| 74 62 6c 20 20 32 35 36 | 20 20 62 6f 75 6e 64 73 |tbl 256| bounds|
|00000b10| 0d 20 20 20 20 20 20 20 | 20 44 4f 20 20 64 75 70 |. | DO dup|
|00000b20| 20 69 20 63 21 20 20 31 | 2b 20 20 4c 4f 4f 50 0d | i c! 1|+ LOOP.|
|00000b30| 20 20 20 20 20 20 20 20 | 64 72 6f 70 20 20 3e 75 | |drop >u|
|00000b40| 63 3a 20 55 43 74 62 6c | 20 20 3b 0d 0d 78 78 20 |c: UCtbl| ;..xx |
|00000b50| 20 0d 6d 5f 5f 78 78 0d | 0d 0d 3a 20 43 43 4d 50 | .m__xx.|..: CCMP|
|00000b60| 20 20 7b 20 61 64 64 72 | 31 20 61 64 64 72 32 20 | { addr|1 addr2 |
|00000b70| 6c 65 6e 20 5c 20 6e 20 | 2d 2d 20 66 6c 67 20 7d |len \ n |-- flg }|
|00000b80| 0d 0d 5c 09 54 68 69 73 | 20 69 73 20 74 68 65 20 |..\.This| is the |
|00000b90| 70 72 69 6d 69 74 69 76 | 65 20 73 75 62 72 6f 75 |primitiv|e subrou|
|00000ba0| 74 69 6e 65 20 66 6f 72 | 20 70 65 72 66 6f 72 6d |tine for| perform|
|00000bb0| 69 6e 67 20 73 74 72 69 | 6e 67 20 63 6f 6d 70 61 |ing stri|ng compa|
|00000bc0| 72 69 73 6f 6e 2e 0d 5c | 09 54 68 65 20 72 65 74 |rison..\|.The ret|
|00000bd0| 75 72 6e 65 64 20 66 6c | 61 67 20 69 73 0d 5c 09 |urned fl|ag is.\.|
|00000be0| 09 2d 31 20 20 20 66 69 | 72 73 74 20 73 74 72 69 |.-1 fi|rst stri|
|00000bf0| 6e 67 20 6c 6f 77 0d 5c | 09 09 30 20 20 20 73 74 |ng low.\|..0 st|
|00000c00| 72 69 6e 67 73 20 61 72 | 65 20 65 71 75 61 6c 0d |rings ar|e equal.|
|00000c10| 5c 09 09 31 20 20 20 66 | 69 72 73 74 20 73 74 72 |\..1 f|irst str|
|00000c20| 69 6e 67 20 68 69 67 68 | 0d 0d 0d 09 6c 65 6e 20 |ing high|....len |
|00000c30| 30 3c 3d 20 49 46 20 20 | 30 20 20 45 58 49 54 20 |0<= IF |0 EXIT |
|00000c40| 20 54 48 45 4e 20 20 20 | 20 20 20 20 5c 20 77 65 | THEN | \ we|
|00000c50| 20 64 65 66 69 6e 65 20 | 65 6d 70 74 79 20 73 74 | define |empty st|
|00000c60| 72 69 6e 67 73 20 74 6f | 20 62 65 20 65 71 75 61 |rings to| be equa|
|00000c70| 6c 0d 09 30 20 2d 3e 20 | 6e 0d 09 63 61 73 65 3f |l..0 -> |n..case?|
|00000c80| 0d 09 49 46 0d 09 09 42 | 45 47 49 4e 0d 09 09 09 |..IF...B|EGIN....|
|00000c90| 61 64 64 72 31 20 63 40 | 20 20 61 64 64 72 32 20 |addr1 c@| addr2 |
|00000ca0| 63 40 20 20 2d 20 20 2d | 3e 20 6e 0d 09 09 09 6e |c@ - -|> n....n|
|00000cb0| 20 49 46 20 20 6e 20 30 | 3e 20 49 46 20 31 20 20 | IF n 0|> IF 1 |
|00000cc0| 45 4c 53 45 20 20 2d 31 | 20 20 54 48 45 4e 20 20 |ELSE -1| THEN |
|00000cd0| 45 58 49 54 0d 09 09 09 | 54 48 45 4e 0d 09 09 09 |EXIT....|THEN....|
|00000ce0| 31 20 2b 2b 3e 20 61 64 | 64 72 31 20 20 31 20 2b |1 ++> ad|dr1 1 +|
|00000cf0| 2b 3e 20 61 64 64 72 32 | 20 20 31 20 2d 2d 3e 20 |+> addr2| 1 --> |
|00000d00| 6c 65 6e 0d 09 09 09 6c | 65 6e 0d 09 09 4e 55 4e |len....l|en...NUN|
|00000d10| 54 49 4c 0d 09 45 4c 53 | 45 0d 09 09 42 45 47 49 |TIL..ELS|E...BEGI|
|00000d20| 4e 0d 09 09 09 61 64 64 | 72 31 20 63 40 20 74 72 |N....add|r1 c@ tr|
|00000d30| 61 6e 73 63 3a 20 75 63 | 54 62 6c 20 20 61 64 64 |ansc: uc|Tbl add|
|00000d40| 72 32 20 63 40 20 20 74 | 72 61 6e 73 63 3a 20 75 |r2 c@ t|ransc: u|
|00000d50| 63 54 62 6c 0d 09 09 09 | 2d 20 20 2d 3e 20 6e 0d |cTbl....|- -> n.|
|00000d60| 09 09 09 6e 20 49 46 20 | 20 6e 20 30 3e 20 49 46 |...n IF | n 0> IF|
|00000d70| 20 20 31 20 20 45 4c 53 | 45 20 20 2d 31 20 20 54 | 1 ELS|E -1 T|
|00000d80| 48 45 4e 20 20 45 58 49 | 54 0d 09 09 09 54 48 45 |HEN EXI|T....THE|
|00000d90| 4e 0d 09 09 09 31 20 2b | 2b 3e 20 61 64 64 72 31 |N....1 +|+> addr1|
|00000da0| 20 20 31 20 2b 2b 3e 20 | 61 64 64 72 32 20 20 31 | 1 ++> |addr2 1|
|00000db0| 20 2d 2d 3e 20 6c 65 6e | 0d 09 09 09 6c 65 6e 0d | --> len|....len.|
|00000dc0| 09 09 4e 55 4e 54 49 4c | 0d 09 54 48 45 4e 0d 09 |..NUNTIL|..THEN..|
|00000dd0| 30 0d 3b 0d 0d 0d 3a 20 | 43 4d 50 53 54 52 20 20 |0.;...: |CMPSTR |
|00000de0| 7b 20 61 64 64 72 31 20 | 6c 65 6e 31 20 61 64 64 |{ addr1 |len1 add|
|00000df0| 72 32 20 6c 65 6e 32 20 | 5c 20 6e 20 2d 2d 20 6e |r2 len2 |\ n -- n|
|00000e00| 20 7d 0d 0d 28 2a 09 55 | 74 69 6c 69 74 79 20 72 | }..(*.U|tility r|
|00000e10| 6f 75 74 69 6e 65 20 74 | 6f 20 63 6f 6d 70 61 72 |outine t|o compar|
|00000e20| 65 20 32 20 73 74 72 69 | 6e 67 73 2e 0d 09 43 61 |e 2 stri|ngs...Ca|
|00000e30| 73 65 20 69 73 20 73 69 | 67 6e 69 66 69 63 61 6e |se is si|gnifican|
|00000e40| 74 20 69 66 20 43 41 53 | 45 3f 20 69 73 20 73 65 |t if CAS|E? is se|
|00000e50| 74 20 74 6f 20 74 72 75 | 65 2e 0d 09 52 65 74 75 |t to tru|e...Retu|
|00000e60| 72 6e 73 3a 0d 09 09 2d | 31 20 20 20 66 69 72 73 |rns:...-|1 firs|
|00000e70| 74 20 73 74 72 69 6e 67 | 20 6c 6f 77 0d 09 09 30 |t string| low...0|
|00000e80| 20 20 20 73 74 72 69 6e | 67 73 20 61 72 65 20 65 | strin|gs are e|
|00000e90| 71 75 61 6c 0d 09 09 31 | 20 20 20 66 69 72 73 74 |qual...1| first|
|00000ea0| 20 73 74 72 69 6e 67 20 | 68 69 67 68 0d 2a 29 0d | string |high.*).|
|00000eb0| 09 30 20 2d 3e 20 6e 09 | 09 09 5c 20 69 6e 69 74 |.0 -> n.|..\ init|
|00000ec0| 69 61 6c 20 64 65 66 61 | 75 6c 74 0d 09 6c 65 6e |ial defa|ult..len|
|00000ed0| 31 20 6c 65 6e 32 20 3e | 09 09 5c 20 63 6f 6d 70 |1 len2 >|..\ comp|
|00000ee0| 61 72 65 20 6c 65 6e 67 | 74 68 73 0d 09 49 46 09 |are leng|ths..IF.|
|00000ef0| 09 09 09 5c 20 6c 65 6e | 31 20 67 72 65 61 74 65 |...\ len|1 greate|
|00000f00| 72 20 2d 20 63 6f 6d 70 | 61 72 65 20 6c 65 6e 32 |r - comp|are len2|
|00000f10| 20 63 68 61 72 73 2c 20 | 69 66 20 65 71 75 61 6c | chars, |if equal|
|00000f20| 2c 20 72 65 74 75 72 6e | 20 31 0d 09 09 31 20 2d |, return| 1...1 -|
|00000f30| 3e 20 6e 0d 09 09 6c 65 | 6e 32 20 2d 3e 20 6c 65 |> n...le|n2 -> le|
|00000f40| 6e 31 0d 09 45 4c 53 45 | 0d 09 09 6c 65 6e 31 20 |n1..ELSE|...len1 |
|00000f50| 6c 65 6e 32 20 3c 0d 09 | 09 49 46 09 09 09 5c 20 |len2 <..|.IF...\ |
|00000f60| 6c 65 6e 32 20 67 72 65 | 61 74 65 72 20 2d 20 63 |len2 gre|ater - c|
|00000f70| 6f 6d 70 61 72 65 20 6c | 65 6e 31 20 63 68 61 72 |ompare l|en1 char|
|00000f80| 73 2c 20 69 66 20 65 71 | 75 61 6c 2c 20 72 65 74 |s, if eq|ual, ret|
|00000f90| 75 72 6e 20 2d 31 0d 09 | 09 09 2d 31 20 2d 3e 20 |urn -1..|..-1 -> |
|00000fa0| 6e 0d 09 09 54 48 45 4e | 0d 09 54 48 45 4e 0d 09 |n...THEN|..THEN..|
|00000fb0| 61 64 64 72 31 20 61 64 | 64 72 32 20 6c 65 6e 31 |addr1 ad|dr2 len1|
|00000fc0| 20 20 63 63 6d 70 0d 09 | 64 75 70 20 4e 49 46 20 | ccmp..|dup NIF |
|00000fd0| 20 64 72 6f 70 20 6e 20 | 20 54 48 45 4e 0d 3b 0d | drop n | THEN.;.|
|00000fe0| 0d 0d 28 2a 09 43 53 43 | 48 20 61 6e 64 20 3c 43 |..(*.CSC|H and <C|
|00000ff0| 53 43 48 20 61 72 65 20 | 74 68 65 20 70 72 69 6d |SCH are |the prim|
|00001000| 69 74 69 76 65 20 73 75 | 62 72 6f 75 74 69 6e 65 |itive su|broutine|
|00001010| 73 20 66 6f 72 20 73 65 | 61 72 63 68 69 6e 67 20 |s for se|arching |
|00001020| 66 6f 72 20 61 20 73 69 | 6e 67 6c 65 0d 09 63 68 |for a si|ngle..ch|
|00001030| 61 72 61 63 74 65 72 2c | 20 77 69 74 68 20 63 61 |aracter,| with ca|
|00001040| 73 65 20 68 61 6e 64 6c | 69 6e 67 2e 20 20 46 6f |se handl|ing. Fo|
|00001050| 72 20 43 53 43 48 2c 20 | 77 65 20 72 65 74 75 72 |r CSCH, |we retur|
|00001060| 6e 20 74 72 75 65 20 69 | 66 20 66 6f 75 6e 64 2c |n true i|f found,|
|00001070| 0d 09 61 6c 6f 6e 67 20 | 77 69 74 68 20 74 68 65 |..along |with the|
|00001080| 20 75 70 64 61 74 65 64 | 20 61 64 64 72 20 61 6e | updated| addr an|
|00001090| 64 20 6c 65 6e 2c 20 6f | 72 20 6a 75 73 74 20 66 |d len, o|r just f|
|000010a0| 61 6c 73 65 20 69 66 20 | 6e 6f 74 20 66 6f 75 6e |alse if |not foun|
|000010b0| 64 2e 20 54 68 65 20 6e | 65 77 0d 09 61 64 64 72 |d. The n|ew..addr|
|000010c0| 20 61 6e 64 20 6c 65 6e | 20 64 65 73 63 72 69 62 | and len| describ|
|000010d0| 65 20 61 20 73 74 72 69 | 6e 67 20 6f 66 20 77 68 |e a stri|ng of wh|
|000010e0| 69 63 68 20 43 48 20 69 | 73 20 74 68 65 20 66 69 |ich CH i|s the fi|
|000010f0| 72 73 74 20 63 68 61 72 | 61 63 74 65 72 2e 0d 09 |rst char|acter...|
|00001100| 46 6f 72 20 3c 43 53 43 | 48 2c 20 77 65 20 72 65 |For <CSC|H, we re|
|00001110| 74 75 72 6e 20 6a 75 73 | 74 20 61 20 6e 65 77 20 |turn jus|t a new |
|00001120| 6c 65 6e 20 76 61 6c 75 | 65 2c 20 74 68 65 20 6c |len valu|e, the l|
|00001130| 65 6e 20 6f 66 20 61 20 | 73 74 72 69 6e 67 20 41 |en of a |string A|
|00001140| 46 54 45 52 20 0d 09 77 | 68 69 63 68 20 43 48 20 |FTER ..w|hich CH |
|00001150| 69 73 20 74 68 65 20 4e | 45 58 54 20 63 68 61 72 |is the N|EXT char|
|00001160| 61 63 74 65 72 2e 0d 2a | 29 0d 0d 3a 20 63 73 63 |acter..*|)..: csc|
|00001170| 68 20 20 7b 20 61 64 64 | 72 20 6c 65 6e 20 63 68 |h { add|r len ch|
|00001180| 20 2d 2d 20 61 64 64 72 | 27 20 6c 65 6e 27 20 74 | -- addr|' len' t|
|00001190| 72 75 65 20 20 7c 20 20 | 2d 2d 20 66 61 6c 73 65 |rue | |-- false|
|000011a0| 20 7d 0d 09 6c 65 6e 20 | 30 3c 3d 20 49 46 20 20 | }..len |0<= IF |
|000011b0| 66 61 6c 73 65 20 20 45 | 58 49 54 20 20 54 48 45 |false E|XIT THE|
|000011c0| 4e 0d 09 63 61 73 65 3f | 0d 09 49 46 0d 09 09 42 |N..case?|..IF...B|
|000011d0| 45 47 49 4e 0d 09 09 09 | 61 64 64 72 20 63 40 20 |EGIN....|addr c@ |
|000011e0| 63 68 20 3d 20 49 46 20 | 20 61 64 64 72 20 6c 65 |ch = IF | addr le|
|000011f0| 6e 20 74 72 75 65 20 20 | 45 58 49 54 20 20 54 48 |n true |EXIT TH|
|00001200| 45 4e 0d 09 09 09 31 20 | 2b 2b 3e 20 61 64 64 72 |EN....1 |++> addr|
|00001210| 20 20 31 20 2d 2d 3e 20 | 6c 65 6e 0d 09 09 09 6c | 1 --> |len....l|
|00001220| 65 6e 0d 09 09 4e 55 4e | 54 49 4c 0d 09 45 4c 53 |en...NUN|TIL..ELS|
|00001230| 45 0d 09 09 63 68 20 20 | 74 72 61 6e 73 63 3a 20 |E...ch |transc: |
|00001240| 75 63 54 62 6c 20 20 2d | 3e 20 63 68 0d 09 09 42 |ucTbl -|> ch...B|
|00001250| 45 47 49 4e 0d 09 09 09 | 61 64 64 72 20 63 40 20 |EGIN....|addr c@ |
|00001260| 74 72 61 6e 73 63 3a 20 | 75 63 54 62 6c 20 20 63 |transc: |ucTbl c|
|00001270| 68 20 3d 20 0d 09 09 09 | 49 46 20 20 61 64 64 72 |h = ....|IF addr|
|00001280| 20 6c 65 6e 20 74 72 75 | 65 20 45 58 49 54 20 20 | len tru|e EXIT |
|00001290| 54 48 45 4e 0d 09 09 09 | 31 20 2b 2b 3e 20 61 64 |THEN....|1 ++> ad|
|000012a0| 64 72 20 20 31 20 2d 2d | 3e 20 6c 65 6e 0d 09 09 |dr 1 --|> len...|
|000012b0| 09 6c 65 6e 0d 09 09 4e | 55 4e 54 49 4c 0d 09 54 |.len...N|UNTIL..T|
|000012c0| 48 45 4e 0d 09 66 61 6c | 73 65 0d 3b 0d 0d 0d 3a |HEN..fal|se.;...:|
|000012d0| 20 3c 63 73 63 68 20 20 | 7b 20 61 64 64 72 20 6c | <csch |{ addr l|
|000012e0| 65 6e 20 63 68 20 2d 2d | 20 6c 65 6e 27 20 74 72 |en ch --| len' tr|
|000012f0| 75 65 20 20 7c 20 20 2d | 2d 20 66 61 6c 73 65 20 |ue | -|- false |
|00001300| 7d 0d 09 6c 65 6e 20 30 | 3c 3d 20 49 46 20 20 66 |}..len 0|<= IF f|
|00001310| 61 6c 73 65 20 20 45 58 | 49 54 20 20 54 48 45 4e |alse EX|IT THEN|
|00001320| 0d 09 6c 65 6e 20 2b 2b | 3e 20 61 64 64 72 20 5c |..len ++|> addr \|
|00001330| 20 70 6f 69 6e 74 20 74 | 6f 20 6f 6e 65 20 62 65 | point t|o one be|
|00001340| 79 6f 6e 64 20 74 68 65 | 20 65 6e 64 20 6f 66 20 |yond the| end of |
|00001350| 74 68 65 20 73 74 72 69 | 6e 67 0d 09 63 61 73 65 |the stri|ng..case|
|00001360| 3f 0d 09 49 46 0d 09 09 | 42 45 47 49 4e 0d 09 09 |?..IF...|BEGIN...|
|00001370| 09 31 20 2d 2d 3e 20 61 | 64 64 72 20 31 20 2d 2d |.1 --> a|ddr 1 --|
|00001380| 3e 20 6c 65 6e 20 0d 09 | 09 09 61 64 64 72 20 63 |> len ..|..addr c|
|00001390| 40 20 63 68 20 3d 20 49 | 46 20 20 6c 65 6e 20 74 |@ ch = I|F len t|
|000013a0| 72 75 65 20 20 45 58 49 | 54 20 20 54 48 45 4e 0d |rue EXI|T THEN.|
|000013b0| 09 09 09 6c 65 6e 0d 09 | 09 4e 55 4e 54 49 4c 0d |...len..|.NUNTIL.|
|000013c0| 09 45 4c 53 45 0d 09 09 | 63 68 20 20 74 72 61 6e |.ELSE...|ch tran|
|000013d0| 73 63 3a 20 75 63 54 62 | 6c 20 20 2d 3e 20 63 68 |sc: ucTb|l -> ch|
|000013e0| 0d 09 09 42 45 47 49 4e | 0d 09 09 09 31 20 2d 2d |...BEGIN|....1 --|
|000013f0| 3e 20 61 64 64 72 20 20 | 31 20 2d 2d 3e 20 6c 65 |> addr |1 --> le|
|00001400| 6e 20 0d 09 09 09 61 64 | 64 72 20 63 40 20 74 72 |n ....ad|dr c@ tr|
|00001410| 61 6e 73 63 3a 20 75 63 | 54 62 6c 20 20 63 68 20 |ansc: uc|Tbl ch |
|00001420| 3d 20 0d 09 09 09 49 46 | 20 20 6c 65 6e 20 74 72 |= ....IF| len tr|
|00001430| 75 65 20 20 45 58 49 54 | 20 54 48 45 4e 0d 09 09 |ue EXIT| THEN...|
|00001440| 09 6c 65 6e 0d 09 09 4e | 55 4e 54 49 4c 0d 09 54 |.len...N|UNTIL..T|
|00001450| 48 45 4e 0d 09 66 61 6c | 73 65 0d 3b 0d 0d 0d 5c |HEN..fal|se.;...\|
|00001460| 20 4e 6f 74 65 3a 20 49 | 4e 53 54 45 41 44 20 69 | Note: I|NSTEAD i|
|00001470| 73 20 69 6e 20 53 74 72 | 55 74 69 6c 69 74 69 65 |s in Str|Utilitie|
|00001480| 73 20 69 6e 20 36 38 6b | 20 4d 6f 70 73 2c 20 62 |s in 68k| Mops, b|
|00001490| 75 74 20 69 6e 20 50 6f | 77 65 72 4d 6f 70 73 20 |ut in Po|werMops |
|000014a0| 69 74 27 73 20 69 6e 20 | 7a 41 72 67 73 2e 0d 0d |it's in |zArgs...|
|000014b0| 5c 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 |\ | |
|000014c0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000014d0| 3d 3d 3d 20 20 53 74 72 | 69 6e 67 2b 20 20 3d 3d |=== Str|ing+ ==|
|000014e0| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |========|========|
|000014f0| 3d 3d 3d 3d 0d 0d 0d 3a | 63 6c 61 73 73 20 20 53 |====...:|class S|
|00001500| 54 52 49 4e 47 2b 20 20 | 73 75 70 65 72 7b 20 73 |TRING+ |super{ s|
|00001510| 74 72 69 6e 67 20 7d 0d | 0d 0d 5c 20 20 20 20 20 |tring }.|..\ |
|00001520| 20 20 20 20 20 20 20 20 | 20 20 3d 3d 3d 3d 3d 3d | | ======|
|00001530| 20 20 55 74 69 6c 69 74 | 79 20 6d 65 74 68 6f 64 | Utilit|y method|
|00001540| 73 20 20 3d 3d 3d 3d 3d | 3d 0d 0d 0d 3a 6d 20 53 |s =====|=...:m S|
|00001550| 57 41 50 50 4f 53 3a 20 | 20 20 20 20 5c 20 53 77 |WAPPOS: | \ Sw|
|00001560| 61 70 73 20 50 4f 53 20 | 77 69 74 68 20 74 68 65 |aps POS |with the|
|00001570| 20 74 6f 70 20 6f 66 20 | 74 68 65 20 73 74 61 63 | top of |the stac|
|00001580| 6b 2e 0d 09 67 65 74 3a | 20 70 6f 73 20 20 73 77 |k...get:| pos sw|
|00001590| 61 70 20 20 70 75 74 3a | 20 70 6f 73 20 20 20 3b |ap put:| pos ;|
|000015a0| 6d 0d 0d 3a 6d 20 53 41 | 56 45 3a 20 5c 20 28 20 |m..:m SA|VE: \ ( |
|000015b0| 2d 2d 20 68 6e 64 20 70 | 6f 73 20 6c 69 6d 20 29 |-- hnd p|os lim )|
|000015c0| 20 20 53 61 76 65 73 20 | 74 68 65 20 73 74 72 69 | Saves |the stri|
|000015d0| 6e 67 2b 20 6f 62 6a 65 | 63 74 20 6f 6e 20 74 68 |ng+ obje|ct on th|
|000015e0| 65 20 73 74 61 63 6b 2e | 0d 09 68 61 6e 64 6c 65 |e stack.|..handle|
|000015f0| 3a 20 73 65 6c 66 20 20 | 70 6f 73 3a 20 73 65 6c |: self |pos: sel|
|00001600| 66 20 20 6c 69 6d 3a 20 | 73 65 6c 66 20 20 20 3b |f lim: |self ;|
|00001610| 6d 0d 0d 3a 6d 20 52 45 | 53 54 4f 52 45 3a 20 20 |m..:m RE|STORE: |
|00001620| 20 20 20 5c 20 28 20 68 | 6e 64 20 70 6f 73 20 6c | \ ( h|nd pos l|
|00001630| 69 6d 20 2d 2d 20 29 20 | 20 4a 75 73 74 20 77 68 |im -- ) | Just wh|
|00001640| 61 74 20 79 6f 75 27 64 | 20 65 78 70 65 63 74 2e |at you'd| expect.|
|00001650| 0d 09 3e 6c 69 6d 3a 20 | 73 65 6c 66 20 20 3e 70 |..>lim: |self >p|
|00001660| 6f 73 3a 20 73 65 6c 66 | 20 20 5e 62 61 73 65 20 |os: self| ^base |
|00001670| 21 20 20 20 3b 6d 0d 0d | 0d 3a 6d 20 32 4e 44 3a |! ;m..|.:m 2ND:|
|00001680| 20 20 20 20 20 20 20 20 | 20 5c 20 28 20 2d 2d 20 | | \ ( -- |
|00001690| 63 20 29 0d 09 31 20 73 | 6b 69 70 3a 20 73 65 6c |c )..1 s|kip: sel|
|000016a0| 66 20 20 31 73 74 3a 20 | 73 65 6c 66 20 20 2d 31 |f 1st: |self -1|
|000016b0| 20 73 6b 69 70 3a 20 73 | 65 6c 66 0d 3b 6d 0d 0d | skip: s|elf.;m..|
|000016c0| 3a 6d 20 4c 41 53 54 3a | 20 20 20 20 20 20 20 20 |:m LAST:| |
|000016d0| 5c 20 28 20 2d 2d 20 63 | 20 29 20 20 52 65 74 75 |\ ( -- c| ) Retu|
|000016e0| 72 6e 73 20 74 68 65 20 | 6c 61 73 74 20 63 68 61 |rns the |last cha|
|000016f0| 72 20 69 6e 20 74 68 65 | 20 61 63 74 69 76 65 20 |r in the| active |
|00001700| 70 61 72 74 0d 09 70 74 | 72 3a 20 73 65 6c 66 20 |part..pt|r: self |
|00001710| 20 67 65 74 3a 20 6c 69 | 6d 20 2b 20 31 2d 20 20 | get: li|m + 1- |
|00001720| 63 40 0d 3b 6d 0d 0d 0d | 5c 20 20 20 20 20 20 20 |c@.;m...|\ |
|00001730| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00001740| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 20 20 43 6f 6d |========|=== Com|
|00001750| 70 61 72 69 73 6f 6e 3a | 20 20 3d 3d 3d 3d 3d 3d |parison:| ======|
|00001760| 3d 3d 3d 3d 3d 0d 0d 3a | 6d 20 43 4f 4d 50 41 52 |=====..:|m COMPAR|
|00001770| 45 3a 09 5c 20 28 20 61 | 64 64 72 20 6c 65 6e 20 |E:.\ ( a|ddr len |
|00001780| 2d 2d 20 6e 20 29 20 20 | 20 43 6f 6d 70 61 72 65 |-- n ) | Compare|
|00001790| 73 20 74 68 65 20 73 74 | 72 69 6e 67 20 28 20 61 |s the st|ring ( a|
|000017a0| 64 64 72 20 6c 65 6e 20 | 29 0d 09 09 09 5c 20 77 |ddr len |)....\ w|
|000017b0| 69 74 68 20 74 68 65 20 | 61 63 74 69 76 65 20 70 |ith the |active p|
|000017c0| 61 72 74 20 6f 66 20 53 | 45 4c 46 2e 20 20 43 6f |art of S|ELF. Co|
|000017d0| 6d 70 61 72 69 73 6f 6e | 20 69 73 0d 09 09 09 5c |mparison| is....\|
|000017e0| 20 62 79 20 43 4d 50 53 | 54 52 2c 20 77 69 74 68 | by CMPS|TR, with|
|000017f0| 20 74 68 65 20 28 20 61 | 64 64 72 20 6c 65 6e 20 | the ( a|ddr len |
|00001800| 29 20 73 74 72 69 6e 67 | 20 61 73 20 74 68 65 20 |) string| as the |
|00001810| 66 69 72 73 74 0d 09 09 | 09 5c 20 6f 70 65 72 61 |first...|.\ opera|
|00001820| 6e 64 2e 20 20 6e 20 69 | 73 20 74 68 65 20 72 65 |nd. n i|s the re|
|00001830| 74 75 72 6e 20 72 65 73 | 75 6c 74 20 61 73 20 64 |turn res|ult as d|
|00001840| 65 73 63 72 69 62 65 64 | 20 61 62 6f 76 65 0d 09 |escribed| above..|
|00001850| 09 09 5c 20 66 6f 72 20 | 43 4d 50 53 54 52 2e 0d |..\ for |CMPSTR..|
|00001860| 09 67 65 74 3a 20 73 65 | 6c 66 20 20 63 6d 70 73 |.get: se|lf cmps|
|00001870| 74 72 20 20 20 3b 6d 0d | 0d 0d 3a 6d 20 3f 3a 20 |tr ;m.|..:m ?: |
|00001880| 20 7b 20 61 64 64 72 20 | 6c 65 6e 20 2d 2d 20 6e | { addr |len -- n|
|00001890| 20 7d 0d 09 09 09 5c 20 | 41 73 20 66 6f 72 20 43 | }....\ |As for C|
|000018a0| 4f 4d 50 41 52 45 3a 2c | 20 65 78 63 65 70 74 20 |OMPARE:,| except |
|000018b0| 74 68 61 74 20 69 66 20 | 74 68 65 20 28 20 61 64 |that if |the ( ad|
|000018c0| 64 72 20 6c 65 6e 20 29 | 20 73 74 72 69 6e 67 0d |dr len )| string.|
|000018d0| 09 09 09 5c 20 69 73 20 | 73 68 6f 72 74 65 72 20 |...\ is |shorter |
|000018e0| 74 68 61 6e 20 74 68 65 | 20 61 63 74 69 76 65 20 |than the| active |
|000018f0| 70 61 72 74 20 6f 66 20 | 53 45 4c 46 2c 20 6f 6e |part of |SELF, on|
|00001900| 6c 79 20 6c 65 6e 20 63 | 68 61 72 73 0d 09 09 09 |ly len c|hars....|
|00001910| 5c 20 66 72 6f 6d 20 74 | 68 65 20 63 75 72 72 65 |\ from t|he curre|
|00001920| 6e 74 20 70 6f 73 69 74 | 69 6f 6e 20 6f 66 20 53 |nt posit|ion of S|
|00001930| 45 4c 46 20 61 72 65 20 | 75 73 65 64 2e 20 20 54 |ELF are |used. T|
|00001940| 68 69 73 20 6f 6e 6c 79 | 0d 09 09 09 5c 20 6d 61 |his only|....\ ma|
|00001950| 6b 65 73 20 61 20 64 69 | 66 66 65 72 65 6e 63 65 |kes a di|fference|
|00001960| 20 69 66 20 61 6e 20 22 | 65 71 75 61 6c 22 20 72 | if an "|equal" r|
|00001970| 65 73 75 6c 74 20 69 73 | 20 6f 62 74 61 69 6e 65 |esult is| obtaine|
|00001980| 64 2e 0d 09 61 64 64 72 | 20 6c 65 6e 20 20 67 65 |d...addr| len ge|
|00001990| 74 3a 20 73 65 6c 66 20 | 20 6c 65 6e 20 6d 69 6e |t: self | len min|
|000019a0| 20 20 63 6d 70 73 74 72 | 20 20 20 3b 6d 0d 0d 0d | cmpstr| ;m...|
|000019b0| 3a 6d 20 3d 3f 3a 20 20 | 7b 20 61 64 64 72 20 6c |:m =?: |{ addr l|
|000019c0| 65 6e 20 2d 2d 20 66 20 | 7d 0d 09 09 09 5c 20 41 |en -- f |}....\ A|
|000019d0| 20 63 6f 6d 70 61 72 65 | 20 66 6f 72 20 65 71 75 | compare| for equ|
|000019e0| 61 6c 2f 6e 6f 74 20 65 | 71 75 61 6c 20 6f 6e 6c |al/not e|qual onl|
|000019f0| 79 2e 0d 09 09 09 5c 20 | 52 65 74 75 72 6e 73 20 |y.....\ |Returns |
|00001a00| 74 72 75 65 20 6f 6e 20 | 65 71 75 61 6c 2e 0d 09 |true on |equal...|
|00001a10| 61 64 64 72 20 6c 65 6e | 20 20 67 65 74 3a 20 73 |addr len| get: s|
|00001a20| 65 6c 66 20 20 6c 65 6e | 20 6d 69 6e 20 20 63 6d |elf len| min cm|
|00001a30| 70 73 74 72 20 30 3d 20 | 20 20 3b 6d 0d 0d 0d 3a |pstr 0= | ;m...:|
|00001a40| 6d 20 43 48 3d 3f 3a 20 | 20 20 20 20 20 20 20 5c |m CH=?: | \|
|00001a50| 20 28 20 63 20 2d 2d 20 | 66 20 29 0d 09 09 09 5c | ( c -- |f )....\|
|00001a60| 20 43 6f 6d 70 61 72 65 | 73 20 74 68 65 20 67 69 | Compare|s the gi|
|00001a70| 76 65 6e 20 73 69 6e 67 | 6c 65 20 63 68 61 72 61 |ven sing|le chara|
|00001a80| 63 74 65 72 20 61 67 61 | 69 6e 73 74 20 74 68 65 |cter aga|inst the|
|00001a90| 20 0d 09 09 09 5c 20 63 | 68 61 72 61 63 74 65 72 | ....\ c|haracter|
|00001aa0| 20 61 74 20 50 4f 53 2e | 20 20 52 65 74 75 72 6e | at POS.| Return|
|00001ab0| 73 20 74 72 75 65 20 6f | 6e 20 65 71 75 61 6c 2e |s true o|n equal.|
|00001ac0| 0d 09 09 09 5c 20 49 66 | 20 74 68 65 20 61 63 74 |....\ If| the act|
|00001ad0| 69 76 65 20 70 61 72 74 | 20 6f 66 20 74 68 65 20 |ive part| of the |
|00001ae0| 73 74 72 69 6e 67 20 69 | 73 20 65 6d 70 74 79 2c |string i|s empty,|
|00001af0| 0d 09 09 09 5c 20 61 6c | 77 61 79 73 20 72 65 74 |....\ al|ways ret|
|00001b00| 75 72 6e 73 20 66 61 6c | 73 65 2e 0d 0d 09 67 65 |urns fal|se....ge|
|00001b10| 74 3a 20 73 65 6c 66 20 | 20 4e 49 46 20 20 32 64 |t: self | NIF 2d|
|00001b20| 72 6f 70 20 66 61 6c 73 | 65 20 20 45 58 49 54 20 |rop fals|e EXIT |
|00001b30| 20 54 48 45 4e 0d 09 63 | 40 0d 09 63 61 73 65 3f | THEN..c|@..case?|
|00001b40| 20 49 46 20 20 74 72 61 | 6e 73 63 3a 20 75 63 54 | IF tra|nsc: ucT|
|00001b50| 62 6c 20 20 54 48 45 4e | 20 20 3d 0d 3b 6d 0d 0d |bl THEN| =.;m..|
|00001b60| 0d 5c 09 09 09 3d 3d 3d | 3d 3d 3d 3d 3d 3d 3d 3d |.\...===|========|
|00001b70| 3d 3d 20 53 65 61 72 63 | 68 69 6e 67 20 3d 3d 3d |== Searc|hing ===|
|00001b80| 3d 3d 3d 3d 3d 3d 3d 3d | 3d 3d 3d 0d 0d 5c 20 53 |========|===..\ S|
|00001b90| 45 41 52 43 48 3a 20 61 | 6e 64 20 3c 53 45 41 52 |EARCH: a|nd <SEAR|
|00001ba0| 43 48 3a 20 73 65 61 72 | 63 68 20 66 6f 72 20 74 |CH: sear|ch for t|
|00001bb0| 68 65 20 70 61 73 73 65 | 64 2d 69 6e 20 73 74 72 |he passe|d-in str|
|00001bc0| 69 6e 67 2e 20 20 54 68 | 65 79 20 72 65 74 75 72 |ing. Th|ey retur|
|00001bd0| 6e 20 61 20 62 6f 6f 6c | 65 61 6e 0d 5c 20 69 6e |n a bool|ean.\ in|
|00001be0| 64 69 63 61 74 69 6e 67 | 20 69 66 20 66 6f 75 6e |dicating| if foun|
|00001bf0| 64 2e 0d 0d 3a 6d 20 53 | 45 41 52 43 48 3a 20 20 |d...:m S|EARCH: |
|00001c00| 7b 20 61 64 64 72 20 6c | 65 6e 20 5c 20 6d 79 41 |{ addr l|en \ myA|
|00001c10| 64 64 72 20 6d 79 4c 65 | 6e 20 63 68 20 2d 2d 20 |ddr myLe|n ch -- |
|00001c20| 62 20 7d 0d 09 67 65 74 | 3a 20 73 65 6c 66 20 20 |b }..get|: self |
|00001c30| 2d 3e 20 6d 79 4c 65 6e | 20 20 2d 3e 20 6d 79 41 |-> myLen| -> myA|
|00001c40| 64 64 72 0d 09 6c 65 6e | 20 4e 49 46 20 20 74 72 |ddr..len| NIF tr|
|00001c50| 75 65 20 20 20 45 58 49 | 54 20 20 54 48 45 4e 20 |ue EXI|T THEN |
|00001c60| 20 5c 20 6f 75 74 20 77 | 69 74 68 20 74 72 75 65 | \ out w|ith true|
|00001c70| 20 69 66 20 73 65 61 72 | 63 68 20 73 74 72 69 6e | if sear|ch strin|
|00001c80| 67 20 65 6d 70 74 79 0d | 0d 09 61 64 64 72 20 63 |g empty.|..addr c|
|00001c90| 40 20 20 20 2d 3e 20 63 | 68 0d 09 42 45 47 49 4e |@ -> c|h..BEGIN|
|00001ca0| 0d 09 09 6c 65 6e 20 6d | 79 4c 65 6e 20 75 3e 20 |...len m|yLen u> |
|00001cb0| 20 0d 09 09 49 46 20 20 | 66 61 6c 73 65 20 20 45 | ...IF |false E|
|00001cc0| 58 49 54 20 20 54 48 45 | 4e 20 20 5c 20 6f 75 74 |XIT THE|N \ out|
|00001cd0| 20 77 69 74 68 20 66 61 | 6c 73 65 20 69 66 20 73 | with fa|lse if s|
|00001ce0| 65 6c 66 20 74 6f 6f 20 | 73 68 6f 72 74 0d 09 09 |elf too |short...|
|00001cf0| 6d 79 41 64 64 72 20 20 | 6d 79 4c 65 6e 20 6c 65 |myAddr |myLen le|
|00001d00| 6e 20 2d 20 31 2b 20 20 | 63 68 20 20 63 73 63 68 |n - 1+ |ch csch|
|00001d10| 20 20 4e 49 46 20 20 66 | 61 6c 73 65 20 20 45 58 | NIF f|alse EX|
|00001d20| 49 54 20 20 54 48 45 4e | 0d 09 09 6c 65 6e 20 2b |IT THEN|...len +|
|00001d30| 20 31 2d 20 2d 3e 20 6d | 79 4c 65 6e 20 20 2d 3e | 1- -> m|yLen ->|
|00001d40| 20 6d 79 41 64 64 72 0d | 09 09 61 64 64 72 20 6d | myAddr.|..addr m|
|00001d50| 79 41 64 64 72 20 6c 65 | 6e 20 20 63 63 6d 70 0d |yAddr le|n ccmp.|
|00001d60| 09 09 49 46 09 09 09 5c | 20 6e 6f 74 20 66 6f 75 |..IF...\| not fou|
|00001d70| 6e 64 20 74 68 69 73 20 | 74 69 6d 65 0d 09 09 09 |nd this |time....|
|00001d80| 31 20 2b 2b 3e 20 6d 79 | 41 64 64 72 20 31 20 2d |1 ++> my|Addr 1 -|
|00001d90| 2d 3e 20 6d 79 4c 65 6e | 0d 09 09 45 4c 53 45 09 |-> myLen|...ELSE.|
|00001da0| 09 5c 20 66 6f 75 6e 64 | 21 0d 09 09 09 6d 79 4c |.\ found|!....myL|
|00001db0| 65 6e 20 6e 65 67 61 74 | 65 20 20 6d 6f 72 65 3a |en negat|e more:|
|00001dc0| 20 73 65 6c 66 0d 09 09 | 09 74 72 75 65 20 20 45 | self...|.true E|
|00001dd0| 58 49 54 0d 09 09 54 48 | 45 4e 0d 09 41 47 41 49 |XIT...TH|EN..AGAI|
|00001de0| 4e 0d 3b 6d 0d 0d 3a 6d | 20 3c 53 45 41 52 43 48 |N.;m..:m| <SEARCH|
|00001df0| 3a 20 20 7b 20 61 64 64 | 72 20 6c 65 6e 20 5c 20 |: { add|r len \ |
|00001e00| 6d 79 41 64 64 72 20 6d | 79 4c 65 6e 20 63 68 20 |myAddr m|yLen ch |
|00001e10| 2d 2d 20 62 20 7d 0d 09 | 6c 65 6e 20 4e 49 46 20 |-- b }..|len NIF |
|00001e20| 20 74 72 75 65 20 20 20 | 45 58 49 54 20 20 54 48 | true |EXIT TH|
|00001e30| 45 4e 20 20 20 20 5c 20 | 6f 75 74 20 77 69 74 68 |EN \ |out with|
|00001e40| 20 74 72 75 65 20 69 66 | 20 73 65 61 72 63 68 20 | true if| search |
|00001e50| 73 74 72 69 6e 67 20 65 | 6d 70 74 79 0d 09 67 65 |string e|mpty..ge|
|00001e60| 74 3a 20 73 65 6c 66 20 | 2d 3e 20 6d 79 4c 65 6e |t: self |-> myLen|
|00001e70| 20 20 2d 3e 20 6d 79 41 | 64 64 72 0d 09 61 64 64 | -> myA|ddr..add|
|00001e80| 72 20 63 40 20 20 20 2d | 3e 20 63 68 0d 09 42 45 |r c@ -|> ch..BE|
|00001e90| 47 49 4e 0d 09 09 6c 65 | 6e 20 6d 79 4c 65 6e 20 |GIN...le|n myLen |
|00001ea0| 75 3e 20 20 0d 09 09 49 | 46 20 20 66 61 6c 73 65 |u> ...I|F false|
|00001eb0| 20 20 45 58 49 54 20 20 | 54 48 45 4e 20 20 20 5c | EXIT |THEN \|
|00001ec0| 20 6f 75 74 20 77 69 74 | 68 20 66 61 6c 73 65 20 | out wit|h false |
|00001ed0| 69 66 20 73 65 6c 66 20 | 74 6f 6f 20 73 68 6f 72 |if self |too shor|
|00001ee0| 74 0d 09 09 6d 79 41 64 | 64 72 20 20 6d 79 4c 65 |t...myAd|dr myLe|
|00001ef0| 6e 20 6c 65 6e 20 2d 20 | 31 2b 20 63 68 20 3c 63 |n len - |1+ ch <c|
|00001f00| 73 63 68 20 4e 49 46 20 | 66 61 6c 73 65 20 20 45 |sch NIF |false E|
|00001f10| 58 49 54 20 20 54 48 45 | 4e 0d 09 09 2d 3e 20 6d |XIT THE|N...-> m|
|00001f20| 79 4c 65 6e 0d 09 09 61 | 64 64 72 20 20 6d 79 41 |yLen...a|ddr myA|
|00001f30| 64 64 72 20 6d 79 4c 65 | 6e 20 2b 20 20 6c 65 6e |ddr myLe|n + len|
|00001f40| 20 20 63 63 6d 70 0d 09 | 09 49 46 20 0d 09 09 09 | ccmp..|.IF ....|
|00001f50| 6c 65 6e 20 31 2d 20 2b | 2b 3e 20 6d 79 4c 65 6e |len 1- +|+> myLen|
|00001f60| 0d 09 09 45 4c 53 45 09 | 5c 20 66 6f 75 6e 64 21 |...ELSE.|\ found!|
|00001f70| 0d 09 09 09 6d 79 4c 65 | 6e 20 20 2b 3a 20 70 6f |....myLe|n +: po|
|00001f80| 73 0d 09 09 09 74 72 75 | 65 20 20 45 58 49 54 0d |s....tru|e EXIT.|
|00001f90| 09 09 54 48 45 4e 0d 09 | 41 47 41 49 4e 0d 3b 6d |..THEN..|AGAIN.;m|
|00001fa0| 0d 0d 0d 3a 6d 20 20 53 | 43 48 26 53 4b 49 50 3a |...:m S|CH&SKIP:|
|00001fb0| 20 20 7b 20 61 64 64 72 | 20 6c 65 6e 20 5c 20 73 | { addr| len \ s|
|00001fc0| 61 76 65 6c 69 6d 20 2d | 2d 20 62 20 7d 0d 09 09 |avelim -|- b }...|
|00001fd0| 09 5c 20 53 65 61 72 63 | 68 65 73 20 66 6f 72 20 |.\ Searc|hes for |
|00001fe0| 74 68 65 20 73 74 72 69 | 6e 67 20 28 20 61 64 64 |the stri|ng ( add|
|00001ff0| 72 20 6c 65 6e 20 29 0d | 09 09 09 5c 20 61 6e 64 |r len ).|...\ and|
|00002000| 20 69 66 20 66 6f 75 6e | 64 2c 20 73 65 74 73 20 | if foun|d, sets |
|00002010| 50 4f 53 20 74 6f 20 74 | 68 65 20 63 68 61 72 61 |POS to t|he chara|
|00002020| 63 74 65 72 20 66 6f 6c | 6c 6f 77 69 6e 67 20 74 |cter fol|lowing t|
|00002030| 68 65 0d 09 09 09 5c 20 | 66 6f 75 6e 64 20 73 75 |he....\ |found su|
|00002040| 62 73 74 72 69 6e 67 2e | 20 20 4c 65 61 76 65 73 |bstring.| Leaves|
|00002050| 20 4c 49 4d 20 75 6e 63 | 68 61 6e 67 65 64 2e 0d | LIM unc|hanged..|
|00002060| 0d 09 67 65 74 3a 20 6c | 69 6d 20 20 2d 3e 20 73 |..get: l|im -> s|
|00002070| 61 76 65 6c 69 6d 0d 09 | 61 64 64 72 20 6c 65 6e |avelim..|addr len|
|00002080| 20 20 73 65 61 72 63 68 | 3a 20 73 65 6c 66 20 20 | search|: self |
|00002090| 64 75 70 20 20 30 45 58 | 49 54 0d 09 73 74 65 70 |dup 0EX|IT..step|
|000020a0| 3a 20 73 65 6c 66 20 20 | 6c 65 6e 20 20 73 6b 69 |: self |len ski|
|000020b0| 70 3a 20 73 65 6c 66 20 | 20 73 61 76 65 6c 69 6d |p: self | savelim|
|000020c0| 20 20 70 75 74 3a 20 6c | 69 6d 20 20 3b 6d 0d 0d | put: l|im ;m..|
|000020d0| 0d 5c 20 43 48 53 45 41 | 52 43 48 3a 20 61 6e 64 |.\ CHSEA|RCH: and|
|000020e0| 20 3c 43 48 53 45 41 52 | 43 48 3a 20 73 65 61 72 | <CHSEAR|CH: sear|
|000020f0| 63 68 20 66 6f 72 20 61 | 20 73 69 6e 67 6c 65 20 |ch for a| single |
|00002100| 63 68 61 72 61 63 74 65 | 72 2e 0d 0d 3a 6d 20 43 |characte|r...:m C|
|00002110| 48 53 45 41 52 43 48 3a | 20 20 7b 20 63 68 20 2d |HSEARCH:| { ch -|
|00002120| 2d 20 62 20 7d 0d 09 67 | 65 74 3a 20 73 65 6c 66 |- b }..g|et: self|
|00002130| 20 20 63 68 20 20 63 73 | 63 68 0d 09 49 46 09 09 | ch cs|ch..IF..|
|00002140| 6e 65 67 61 74 65 20 6d | 6f 72 65 3a 20 73 65 6c |negate m|ore: sel|
|00002150| 66 20 20 64 72 6f 70 20 | 20 74 72 75 65 0d 09 45 |f drop | true..E|
|00002160| 4c 53 45 09 66 61 6c 73 | 65 0d 09 54 48 45 4e 0d |LSE.fals|e..THEN.|
|00002170| 3b 6d 0d 0d 0d 3a 6d 20 | 3c 43 48 53 45 41 52 43 |;m...:m |<CHSEARC|
|00002180| 48 3a 20 20 7b 20 63 68 | 20 2d 2d 20 62 20 7d 0d |H: { ch| -- b }.|
|00002190| 09 67 65 74 3a 20 73 65 | 6c 66 20 20 63 68 20 20 |.get: se|lf ch |
|000021a0| 3c 63 73 63 68 0d 09 49 | 46 09 09 73 6b 69 70 3a |<csch..I|F..skip:|
|000021b0| 20 73 65 6c 66 20 20 74 | 72 75 65 0d 09 45 4c 53 | self t|rue..ELS|
|000021c0| 45 09 66 61 6c 73 65 0d | 09 54 48 45 4e 0d 3b 6d |E.false.|.THEN.;m|
|000021d0| 0d 0d 0d 3a 6d 20 43 48 | 53 43 48 26 53 4b 49 50 |...:m CH|SCH&SKIP|
|000021e0| 3a 20 20 7b 20 63 20 5c | 20 73 61 76 65 6c 69 6d |: { c \| savelim|
|000021f0| 20 2d 2d 20 62 20 7d 0d | 09 67 65 74 3a 20 6c 69 | -- b }.|.get: li|
|00002200| 6d 20 20 2d 3e 20 73 61 | 76 65 6c 69 6d 0d 09 63 |m -> sa|velim..c|
|00002210| 20 20 63 68 73 65 61 72 | 63 68 3a 20 73 65 6c 66 | chsear|ch: self|
|00002220| 20 20 64 75 70 20 20 30 | 45 58 49 54 0d 09 73 74 | dup 0|EXIT..st|
|00002230| 65 70 3a 20 73 65 6c 66 | 20 20 31 20 73 6b 69 70 |ep: self| 1 skip|
|00002240| 3a 20 73 65 6c 66 20 20 | 73 61 76 65 6c 69 6d 20 |: self |savelim |
|00002250| 20 70 75 74 3a 20 6c 69 | 6d 20 20 3b 6d 0d 0d 0d | put: li|m ;m...|
|00002260| 5c 20 43 48 53 4b 49 50 | 3f 3a 20 20 28 20 63 20 |\ CHSKIP|?: ( c |
|00002270| 2d 2d 20 62 20 29 20 20 | 73 65 61 72 63 68 65 73 |-- b ) |searches|
|00002280| 20 66 6f 72 20 74 68 65 | 20 66 69 72 73 74 20 63 | for the| first c|
|00002290| 68 61 72 61 63 74 65 72 | 20 4e 4f 54 20 65 71 75 |haracter| NOT equ|
|000022a0| 61 6c 20 74 6f 20 63 2e | 0d 5c 20 54 68 69 73 20 |al to c.|.\ This |
|000022b0| 6d 65 74 68 6f 64 20 68 | 61 73 20 61 20 63 6f 75 |method h|as a cou|
|000022c0| 70 6c 65 20 6f 66 20 64 | 69 66 66 65 72 65 6e 63 |ple of d|ifferenc|
|000022d0| 65 73 20 74 6f 20 74 68 | 65 20 6f 74 68 65 72 20 |es to th|e other |
|000022e0| 73 65 61 72 63 68 69 6e | 67 20 6d 65 74 68 6f 64 |searchin|g method|
|000022f0| 73 2c 20 0d 5c 20 64 69 | 63 74 61 74 65 64 20 62 |s, .\ di|ctated b|
|00002300| 79 20 77 68 61 74 20 77 | 65 20 6e 6f 72 6d 61 6c |y what w|e normal|
|00002310| 6c 79 20 6e 65 65 64 20 | 69 74 20 66 6f 72 2e 20 |ly need |it for. |
|00002320| 20 49 66 20 69 74 20 73 | 75 63 65 65 64 73 2c 20 | If it s|uceeds, |
|00002330| 50 4f 53 20 28 6e 6f 74 | 20 4c 49 4d 29 20 69 73 |POS (not| LIM) is|
|00002340| 20 0d 5c 20 73 65 74 20 | 74 6f 20 74 68 61 74 20 | .\ set |to that |
|00002350| 70 6f 73 69 74 69 6f 6e | 2c 20 61 6e 64 20 69 74 |position|, and it|
|00002360| 20 69 73 20 61 6c 77 61 | 79 73 20 63 61 73 65 20 | is alwa|ys case |
|00002370| 73 65 6e 73 69 74 69 76 | 65 2c 20 72 65 67 61 72 |sensitiv|e, regar|
|00002380| 64 6c 65 73 73 20 6f 66 | 20 43 41 53 45 3f 2e 0d |dless of| CASE?..|
|00002390| 0d 3a 6d 20 43 48 53 4b | 49 50 3f 3a 20 20 7b 20 |.:m CHSK|IP?: { |
|000023a0| 63 68 20 5c 20 61 64 64 | 72 20 6c 65 6e 20 2d 2d |ch \ add|r len --|
|000023b0| 20 62 20 7d 0d 09 67 65 | 74 3a 20 73 65 6c 66 20 | b }..ge|t: self |
|000023c0| 20 2d 3e 20 6c 65 6e 20 | 20 2d 3e 20 61 64 64 72 | -> len | -> addr|
|000023d0| 0d 09 6c 65 6e 20 30 3c | 3d 20 49 46 20 20 66 61 |..len 0<|= IF fa|
|000023e0| 6c 73 65 20 20 45 58 49 | 54 20 20 54 48 45 4e 0d |lse EXI|T THEN.|
|000023f0| 09 42 45 47 49 4e 0d 09 | 09 61 64 64 72 20 63 40 |.BEGIN..|.addr c@|
|00002400| 20 63 68 20 3c 3e 20 0d | 09 09 49 46 20 20 67 65 | ch <> .|..IF ge|
|00002410| 74 3a 20 6c 69 6d 20 20 | 6c 65 6e 20 2d 20 20 70 |t: lim |len - p|
|00002420| 75 74 3a 20 70 6f 73 20 | 20 74 72 75 65 20 20 45 |ut: pos | true E|
|00002430| 58 49 54 20 54 48 45 4e | 0d 09 09 31 20 2b 2b 3e |XIT THEN|...1 ++>|
|00002440| 20 61 64 64 72 20 20 31 | 20 2d 2d 3e 20 6c 65 6e | addr 1| --> len|
|00002450| 0d 09 09 6c 65 6e 0d 09 | 4e 55 4e 54 49 4c 0d 09 |...len..|NUNTIL..|
|00002460| 66 61 6c 73 65 0d 3b 6d | 0d 0d 0d 3a 6d 20 20 43 |false.;m|...:m C|
|00002470| 48 53 4b 49 50 3a 20 20 | 20 20 20 20 20 20 20 20 |HSKIP: | |
|00002480| 20 20 20 5c 20 28 20 63 | 20 2d 2d 20 29 20 20 41 | \ ( c| -- ) A|
|00002490| 73 20 66 6f 72 20 43 48 | 53 4b 49 50 3f 3a 2c 20 |s for CH|SKIP?:, |
|000024a0| 62 75 74 20 72 65 74 75 | 72 6e 73 20 6e 6f 20 72 |but retu|rns no r|
|000024b0| 65 73 75 6c 74 2e 0d 09 | 63 68 73 6b 69 70 3f 3a |esult...|chskip?:|
|000024c0| 20 73 65 6c 66 20 20 64 | 72 6f 70 20 20 20 3b 6d | self d|rop ;m|
|000024d0| 0d 0d 0d 28 2a 09 53 43 | 41 4e 3a 20 61 6e 64 20 |...(*.SC|AN: and |
|000024e0| 3c 53 43 41 4e 3a 20 73 | 65 61 72 63 68 20 66 6f |<SCAN: s|earch fo|
|000024f0| 72 20 61 20 73 69 6e 67 | 6c 65 20 63 68 61 72 61 |r a sing|le chara|
|00002500| 63 74 65 72 2c 20 75 73 | 69 6e 67 20 61 20 74 72 |cter, us|ing a tr|
|00002510| 61 6e 73 6c 61 74 65 20 | 74 61 62 6c 65 2e 0d 09 |anslate |table...|
|00002520| 22 53 75 63 63 65 73 73 | 22 20 69 73 20 64 65 66 |"Success|" is def|
|00002530| 69 6e 65 64 20 61 73 20 | 61 20 63 68 61 72 61 63 |ined as |a charac|
|00002540| 74 65 72 20 77 68 69 63 | 68 20 79 69 65 6c 64 73 |ter whic|h yields|
|00002550| 20 61 20 6e 6f 6e 2d 7a | 65 72 6f 20 76 61 6c 75 | a non-z|ero valu|
|00002560| 65 20 66 72 6f 6d 0d 09 | 74 68 65 20 74 61 62 6c |e from..|the tabl|
|00002570| 65 2e 20 20 54 68 65 20 | 72 65 74 75 72 6e 20 72 |e. The |return r|
|00002580| 65 73 75 6c 74 20 69 73 | 20 74 68 69 73 20 6e 6f |esult is| this no|
|00002590| 6e 2d 7a 65 72 6f 20 76 | 61 6c 75 65 2c 20 6f 72 |n-zero v|alue, or|
|000025a0| 20 7a 65 72 6f 20 69 66 | 20 6e 6f 6e 65 0d 09 77 | zero if| none..w|
|000025b0| 61 73 20 66 6f 75 6e 64 | 2e 0d 2a 29 0d 0d 0d 3a |as found|..*)...:|
|000025c0| 6d 20 53 43 41 4e 3a 20 | 20 7b 20 5e 74 72 74 62 |m SCAN: | { ^trtb|
|000025d0| 6c 20 5c 20 61 64 64 72 | 20 6c 65 6e 20 2d 2d 20 |l \ addr| len -- |
|000025e0| 6e 20 7d 0d 09 67 65 74 | 3a 20 73 65 6c 66 20 20 |n }..get|: self |
|000025f0| 2d 3e 20 6c 65 6e 20 20 | 2d 3e 20 61 64 64 72 0d |-> len |-> addr.|
|00002600| 09 6c 65 6e 20 30 3c 3d | 20 49 46 20 20 30 20 20 |.len 0<=| IF 0 |
|00002610| 45 58 49 54 20 20 54 48 | 45 4e 0d 09 30 20 20 20 |EXIT TH|EN..0 |
|00002620| 20 20 20 20 20 20 20 20 | 20 20 20 20 5c 20 64 75 | | \ du|
|00002630| 6d 6d 79 20 74 6f 20 64 | 72 6f 70 0d 09 42 45 47 |mmy to d|rop..BEG|
|00002640| 49 4e 0d 09 09 64 72 6f | 70 0d 09 09 61 64 64 72 |IN...dro|p...addr|
|00002650| 20 63 40 20 20 5e 74 72 | 74 62 6c 20 74 72 61 6e | c@ ^tr|tbl tran|
|00002660| 73 63 3a 20 63 6c 61 73 | 73 5f 61 73 3e 20 54 72 |sc: clas|s_as> Tr|
|00002670| 54 62 6c 20 20 64 75 70 | 0d 09 09 49 46 20 20 20 |Tbl dup|...IF |
|00002680| 20 20 20 67 65 74 3a 20 | 6c 69 6d 20 20 6c 65 6e | get: |lim len|
|00002690| 20 2d 20 20 70 75 74 3a | 20 6c 69 6d 20 20 45 58 | - put:| lim EX|
|000026a0| 49 54 0d 09 09 54 48 45 | 4e 0d 09 09 31 20 2b 2b |IT...THE|N...1 ++|
|000026b0| 3e 20 61 64 64 72 20 20 | 31 20 2d 2d 3e 20 6c 65 |> addr |1 --> le|
|000026c0| 6e 0d 09 09 6c 65 6e 0d | 09 4e 55 4e 54 49 4c 0d |n...len.|.NUNTIL.|
|000026d0| 3b 6d 0d 0d 3a 6d 20 3c | 53 43 41 4e 3a 20 20 7b |;m..:m <|SCAN: {|
|000026e0| 20 5e 74 72 74 62 6c 20 | 5c 20 61 64 64 72 20 6c | ^trtbl |\ addr l|
|000026f0| 65 6e 20 2d 2d 20 6e 20 | 7d 0d 09 67 65 74 3a 20 |en -- n |}..get: |
|00002700| 73 65 6c 66 20 20 2d 3e | 20 6c 65 6e 20 20 2d 3e |self ->| len ->|
|00002710| 20 61 64 64 72 0d 09 6c | 65 6e 20 30 3c 3d 20 49 | addr..l|en 0<= I|
|00002720| 46 20 20 30 20 20 45 58 | 49 54 20 20 54 48 45 4e |F 0 EX|IT THEN|
|00002730| 0d 09 6c 65 6e 20 31 2d | 20 20 2b 2b 3e 20 61 64 |..len 1-| ++> ad|
|00002740| 64 72 0d 09 30 20 20 20 | 20 20 20 20 20 20 20 20 |dr..0 | |
|00002750| 20 20 20 20 5c 20 64 75 | 6d 6d 79 20 74 6f 20 64 | \ du|mmy to d|
|00002760| 72 6f 70 0d 09 42 45 47 | 49 4e 0d 09 09 64 72 6f |rop..BEG|IN...dro|
|00002770| 70 0d 09 09 61 64 64 72 | 20 63 40 20 20 5e 74 72 |p...addr| c@ ^tr|
|00002780| 74 62 6c 20 74 72 61 6e | 73 63 3a 20 63 6c 61 73 |tbl tran|sc: clas|
|00002790| 73 5f 61 73 3e 20 54 72 | 54 62 6c 20 20 64 75 70 |s_as> Tr|Tbl dup|
|000027a0| 0d 09 09 49 46 20 20 6c | 65 6e 20 31 2d 20 73 6b |...IF l|en 1- sk|
|000027b0| 69 70 3a 20 73 65 6c 66 | 20 20 45 58 49 54 0d 09 |ip: self| EXIT..|
|000027c0| 09 54 48 45 4e 0d 09 09 | 31 20 2d 2d 3e 20 61 64 |.THEN...|1 --> ad|
|000027d0| 64 72 20 20 31 20 2d 2d | 3e 20 6c 65 6e 0d 09 09 |dr 1 --|> len...|
|000027e0| 6c 65 6e 0d 09 4e 55 4e | 54 49 4c 0d 3b 6d 0d 0d |len..NUN|TIL.;m..|
|000027f0| 0d 28 2a 09 53 43 41 58 | 3a 20 61 6e 64 20 3c 53 |.(*.SCAX|: and <S|
|00002800| 43 41 58 3a 20 2d 20 22 | 53 63 61 6e 20 65 78 63 |CAX: - "|Scan exc|
|00002810| 6c 75 64 69 6e 67 22 2e | 20 20 41 73 20 66 6f 72 |luding".| As for|
|00002820| 20 73 63 61 6e 3a 2c 20 | 62 75 74 20 22 73 75 63 | scan:, |but "suc|
|00002830| 63 65 73 73 22 20 69 73 | 0d 09 64 65 66 69 6e 65 |cess" is|..define|
|00002840| 64 20 61 73 20 61 20 63 | 68 61 72 61 63 74 65 72 |d as a c|haracter|
|00002850| 20 77 68 69 63 68 20 79 | 69 65 6c 64 73 20 61 20 | which y|ields a |
|00002860| 7a 65 72 6f 20 76 61 6c | 75 65 20 66 72 6f 6d 20 |zero val|ue from |
|00002870| 74 68 65 20 74 61 62 6c | 65 2e 0d 09 54 68 65 20 |the tabl|e...The |
|00002880| 72 65 74 75 72 6e 20 72 | 65 73 75 6c 74 20 69 73 |return r|esult is|
|00002890| 20 74 68 65 20 6c 61 73 | 74 20 62 79 74 65 20 66 | the las|t byte f|
|000028a0| 65 74 63 68 65 64 20 66 | 72 6f 6d 20 74 68 65 20 |etched f|rom the |
|000028b0| 74 61 62 6c 65 2c 20 77 | 68 69 63 68 0d 09 77 69 |table, w|hich..wi|
|000028c0| 6c 6c 20 62 65 20 7a 65 | 72 6f 20 6f 6e 20 73 75 |ll be ze|ro on su|
|000028d0| 63 63 65 73 73 2c 20 6f | 72 20 6f 74 68 65 72 77 |ccess, o|r otherw|
|000028e0| 69 73 65 20 69 74 20 77 | 69 6c 6c 20 62 65 20 77 |ise it w|ill be w|
|000028f0| 68 61 74 65 76 65 72 20 | 74 61 62 6c 65 20 62 79 |hatever |table by|
|00002900| 74 65 0d 09 63 6f 72 72 | 65 73 70 6f 6e 64 73 20 |te..corr|esponds |
|00002910| 74 6f 20 74 68 65 20 6c | 61 73 74 20 63 68 61 72 |to the l|ast char|
|00002920| 20 69 6e 20 74 68 65 20 | 61 63 74 69 76 65 20 70 | in the |active p|
|00002930| 61 72 74 20 6f 66 20 74 | 68 65 20 73 74 72 69 6e |art of t|he strin|
|00002940| 67 20 2d 0d 09 73 6f 6d | 65 74 68 69 6e 67 20 6e |g -..som|ething n|
|00002950| 6f 6e 2d 7a 65 72 6f 2c | 20 69 6e 20 61 6e 79 20 |on-zero,| in any |
|00002960| 63 61 73 65 2e 0d 2a 29 | 0d 0d 3a 6d 20 53 43 41 |case..*)|..:m SCA|
|00002970| 58 3a 20 20 7b 20 5e 74 | 72 74 62 6c 20 5c 20 61 |X: { ^t|rtbl \ a|
|00002980| 64 64 72 20 6c 65 6e 20 | 2d 2d 20 6e 20 7d 0d 09 |ddr len |-- n }..|
|00002990| 67 65 74 3a 20 73 65 6c | 66 20 20 2d 3e 20 6c 65 |get: sel|f -> le|
|000029a0| 6e 20 20 2d 3e 20 61 64 | 64 72 0d 09 6c 65 6e 20 |n -> ad|dr..len |
|000029b0| 30 3c 3d 20 49 46 20 20 | 30 20 20 45 58 49 54 20 |0<= IF |0 EXIT |
|000029c0| 20 54 48 45 4e 0d 09 30 | 20 20 20 20 20 20 20 20 | THEN..0| |
|000029d0| 20 20 20 20 20 20 20 5c | 20 64 75 6d 6d 79 20 74 | \| dummy t|
|000029e0| 6f 20 64 72 6f 70 0d 09 | 42 45 47 49 4e 0d 09 09 |o drop..|BEGIN...|
|000029f0| 64 72 6f 70 0d 09 09 61 | 64 64 72 20 63 40 20 20 |drop...a|ddr c@ |
|00002a00| 5e 74 72 74 62 6c 20 74 | 72 61 6e 73 63 3a 20 63 |^trtbl t|ransc: c|
|00002a10| 6c 61 73 73 5f 61 73 3e | 20 54 72 54 62 6c 20 20 |lass_as>| TrTbl |
|00002a20| 64 75 70 0d 09 09 4e 49 | 46 20 67 65 74 3a 20 6c |dup...NI|F get: l|
|00002a30| 69 6d 20 20 6c 65 6e 20 | 2d 20 20 70 75 74 3a 20 |im len |- put: |
|00002a40| 6c 69 6d 20 20 45 58 49 | 54 0d 09 09 54 48 45 4e |lim EXI|T...THEN|
|00002a50| 0d 09 09 31 20 2b 2b 3e | 20 61 64 64 72 20 20 31 |...1 ++>| addr 1|
|00002a60| 20 2d 2d 3e 20 6c 65 6e | 0d 09 09 6c 65 6e 0d 09 | --> len|...len..|
|00002a70| 4e 55 4e 54 49 4c 0d 3b | 6d 0d 0d 3a 6d 20 3c 53 |NUNTIL.;|m..:m <S|
|00002a80| 43 41 58 3a 20 20 7b 20 | 5e 74 72 74 62 6c 20 5c |CAX: { |^trtbl \|
|00002a90| 20 61 64 64 72 20 6c 65 | 6e 20 2d 2d 20 6e 20 7d | addr le|n -- n }|
|00002aa0| 0d 09 67 65 74 3a 20 73 | 65 6c 66 20 20 2d 3e 20 |..get: s|elf -> |
|00002ab0| 6c 65 6e 20 20 2d 3e 20 | 61 64 64 72 0d 09 6c 65 |len -> |addr..le|
|00002ac0| 6e 20 30 3c 3d 20 49 46 | 20 20 30 20 20 45 58 49 |n 0<= IF| 0 EXI|
|00002ad0| 54 20 20 54 48 45 4e 0d | 09 6c 65 6e 20 31 2d 20 |T THEN.|.len 1- |
|00002ae0| 20 2b 2b 3e 20 61 64 64 | 72 0d 09 30 20 20 20 20 | ++> add|r..0 |
|00002af0| 20 20 20 20 20 20 20 20 | 20 20 20 5c 20 64 75 6d | | \ dum|
|00002b00| 6d 79 20 74 6f 20 64 72 | 6f 70 0d 09 42 45 47 49 |my to dr|op..BEGI|
|00002b10| 4e 0d 09 09 64 72 6f 70 | 0d 09 09 61 64 64 72 20 |N...drop|...addr |
|00002b20| 63 40 20 20 5e 74 72 74 | 62 6c 20 74 72 61 6e 73 |c@ ^trt|bl trans|
|00002b30| 63 3a 20 63 6c 61 73 73 | 5f 61 73 3e 20 54 72 54 |c: class|_as> TrT|
|00002b40| 62 6c 20 20 64 75 70 0d | 09 09 4e 49 46 20 6c 65 |bl dup.|..NIF le|
|00002b50| 6e 20 31 2d 20 73 6b 69 | 70 3a 20 73 65 6c 66 20 |n 1- ski|p: self |
|00002b60| 20 45 58 49 54 0d 09 09 | 54 48 45 4e 0d 09 09 31 | EXIT...|THEN...1|
|00002b70| 20 2d 2d 3e 20 61 64 64 | 72 20 20 31 20 2d 2d 3e | --> add|r 1 -->|
|00002b80| 20 6c 65 6e 0d 09 09 6c | 65 6e 0d 09 4e 55 4e 54 | len...l|en..NUNT|
|00002b90| 49 4c 0d 3b 6d 0d 0d 0d | 3a 6d 20 54 52 41 4e 53 |IL.;m...|:m TRANS|
|00002ba0| 4c 41 54 45 3a 20 20 7b | 20 5e 74 72 74 62 6c 20 |LATE: {| ^trtbl |
|00002bb0| 5c 20 61 64 64 72 20 6c | 65 6e 20 2d 2d 20 7d 0d |\ addr l|en -- }.|
|00002bc0| 09 67 65 74 3a 20 73 65 | 6c 66 20 20 2d 3e 20 6c |.get: se|lf -> l|
|00002bd0| 65 6e 20 20 2d 3e 20 61 | 64 64 72 0d 09 6c 65 6e |en -> a|ddr..len|
|00002be0| 20 30 45 58 49 54 0d 09 | 6c 65 6e 20 46 4f 52 0d | 0EXIT..|len FOR.|
|00002bf0| 09 09 61 64 64 72 20 63 | 40 20 20 5e 74 72 74 62 |..addr c|@ ^trtb|
|00002c00| 6c 20 74 72 61 6e 73 63 | 3a 20 63 6c 61 73 73 5f |l transc|: class_|
|00002c10| 61 73 3e 20 54 72 54 62 | 6c 20 20 61 64 64 72 20 |as> TrTb|l addr |
|00002c20| 63 21 0d 09 09 31 20 2b | 2b 3e 20 61 64 64 72 0d |c!...1 +|+> addr.|
|00002c30| 09 4e 45 58 54 0d 3b 6d | 0d 0d 0d 3a 6d 20 54 52 |.NEXT.;m|...:m TR|
|00002c40| 41 4e 53 31 53 54 3a 20 | 20 7b 20 5e 74 72 74 62 |ANS1ST: | { ^trtb|
|00002c50| 6c 20 5c 20 61 64 64 72 | 20 6c 65 6e 20 2d 2d 20 |l \ addr| len -- |
|00002c60| 6e 20 7d 0d 09 67 65 74 | 3a 20 73 65 6c 66 20 20 |n }..get|: self |
|00002c70| 2d 3e 20 6c 65 6e 20 20 | 2d 3e 20 61 64 64 72 0d |-> len |-> addr.|
|00002c80| 09 6c 65 6e 20 30 3c 3d | 20 20 3f 45 58 49 54 0d |.len 0<=| ?EXIT.|
|00002c90| 09 61 64 64 72 20 63 40 | 20 20 5e 74 72 74 62 6c |.addr c@| ^trtbl|
|00002ca0| 20 74 72 61 6e 73 63 3a | 20 63 6c 61 73 73 5f 61 | transc:| class_a|
|00002cb0| 73 3e 20 54 72 54 62 6c | 0d 3b 6d 0d 0d 0d 3a 6d |s> TrTbl|.;m...:m|
|00002cc0| 20 20 3e 55 43 3a 20 20 | 20 20 20 20 20 20 20 20 | >UC: | |
|00002cd0| 20 20 20 20 20 20 5c 20 | 46 61 73 74 65 72 20 74 | \ |Faster t|
|00002ce0| 68 61 6e 20 55 50 50 45 | 52 2c 20 61 6e 64 20 6e |han UPPE|R, and n|
|00002cf0| 6f 74 20 6c 69 6d 69 74 | 65 64 20 74 6f 20 36 34 |ot limit|ed to 64|
|00002d00| 4b 2e 0d 09 75 63 54 62 | 6c 20 20 74 72 61 6e 73 |K...ucTb|l trans|
|00002d10| 6c 61 74 65 3a 20 73 65 | 6c 66 20 20 20 3b 6d 0d |late: se|lf ;m.|
|00002d20| 0d 3a 6d 20 20 43 48 3e | 55 43 3a 20 20 20 20 20 |.:m CH>|UC: |
|00002d30| 20 5c 20 43 6f 6e 76 65 | 72 74 73 20 74 68 65 20 | \ Conve|rts the |
|00002d40| 66 69 72 73 74 20 63 68 | 61 72 20 6f 66 20 53 45 |first ch|ar of SE|
|00002d50| 4c 46 20 74 6f 20 75 70 | 70 65 72 20 63 61 73 65 |LF to up|per case|
|00002d60| 2e 0d 09 75 63 54 62 6c | 20 20 74 72 61 6e 73 31 |...ucTbl| trans1|
|00002d70| 73 74 3a 20 73 65 6c 66 | 20 20 20 5e 31 73 74 3a |st: self| ^1st:|
|00002d80| 20 73 65 6c 66 20 20 63 | 21 20 20 20 3b 6d 0d 0d | self c|! ;m..|
|00002d90| 0d 5c 20 20 20 20 20 20 | 20 3d 3d 3d 3d 3d 3d 3d |.\ | =======|
|00002da0| 3d 3d 20 49 6e 73 65 72 | 74 69 6f 6e 2c 20 64 65 |== Inser|tion, de|
|00002db0| 6c 65 74 69 6f 6e 2c 20 | 72 65 70 6c 61 63 65 6d |letion, |replacem|
|00002dc0| 65 6e 74 20 3d 3d 3d 3d | 3d 3d 3d 3d 3d 3d 0d 0d |ent ====|======..|
|00002dd0| 28 2a 09 54 68 65 20 66 | 6f 6c 6c 6f 77 69 6e 67 |(*.The f|ollowing|
|00002de0| 20 61 72 65 20 61 6c 6c | 20 69 6e 20 63 6c 61 73 | are all| in clas|
|00002df0| 73 20 53 74 72 69 6e 67 | 20 69 6e 20 50 6f 77 65 |s String| in Powe|
|00002e00| 72 4d 6f 70 73 2c 20 73 | 69 6e 63 65 20 77 65 0d |rMops, s|ince we.|
|00002e10| 09 6e 65 65 64 20 74 68 | 65 6d 20 65 61 72 6c 69 |.need th|em earli|
|00002e20| 65 72 20 74 68 61 6e 20 | 53 74 72 69 6e 67 2b 3a |er than |String+:|
|00002e30| 0d 0d 09 09 63 68 69 6e | 73 65 72 74 3a 0d 09 09 |....chin|sert:...|
|00002e40| 6f 76 77 72 3a 0d 09 09 | 63 68 6f 76 77 72 3a 0d |ovwr:...|chovwr:.|
|00002e50| 09 09 24 6f 76 77 72 3a | 0d 09 09 72 65 70 6c 3a |..$ovwr:|...repl:|
|00002e60| 0d 09 09 24 72 65 70 6c | 3a 0d 09 09 64 65 6c 65 |...$repl|:...dele|
|00002e70| 74 65 3a 0d 09 09 64 65 | 6c 65 74 65 4e 3a 0d 2a |te:...de|leteN:.*|
|00002e80| 29 0d 0d 0d 3a 6d 20 53 | 43 48 26 52 45 50 4c 3a |)...:m S|CH&REPL:|
|00002e90| 20 20 7b 20 61 64 64 72 | 31 20 6c 65 6e 31 20 61 | { addr|1 len1 a|
|00002ea0| 64 64 72 32 20 6c 65 6e | 32 20 2d 2d 20 62 20 7d |ddr2 len|2 -- b }|
|00002eb0| 0d 09 61 64 64 72 31 20 | 6c 65 6e 31 20 20 73 65 |..addr1 |len1 se|
|00002ec0| 61 72 63 68 3a 20 73 65 | 6c 66 20 20 64 75 70 20 |arch: se|lf dup |
|00002ed0| 20 30 45 58 49 54 0d 09 | 73 74 65 70 3a 20 73 65 | 0EXIT..|step: se|
|00002ee0| 6c 66 0d 09 6c 65 6e 31 | 20 20 61 64 64 72 32 20 |lf..len1| addr2 |
|00002ef0| 6c 65 6e 32 20 20 28 72 | 65 70 6c 29 3a 20 73 65 |len2 (r|epl): se|
|00002f00| 6c 66 0d 09 67 65 74 3a | 20 70 6f 73 20 20 70 75 |lf..get:| pos pu|
|00002f10| 74 3a 20 6c 69 6d 0d 3b | 6d 0d 0d 0d 3a 6d 20 52 |t: lim.;|m...:m R|
|00002f20| 45 50 4c 41 4c 4c 3a 20 | 20 7b 20 61 64 64 72 31 |EPLALL: | { addr1|
|00002f30| 20 6c 65 6e 31 20 61 64 | 64 72 32 20 6c 65 6e 32 | len1 ad|dr2 len2|
|00002f40| 20 2d 2d 20 7d 0d 09 09 | 09 5c 20 52 65 70 6c 61 | -- }...|.\ Repla|
|00002f50| 63 65 73 20 61 6c 6c 20 | 6f 63 63 75 72 72 65 6e |ces all |occurren|
|00002f60| 63 65 73 20 6f 66 20 28 | 61 64 64 72 31 20 6c 65 |ces of (|addr1 le|
|00002f70| 6e 31 29 20 62 79 20 28 | 61 64 64 72 32 20 6c 65 |n1) by (|addr2 le|
|00002f80| 6e 32 29 0d 09 09 09 5c | 20 69 6e 20 74 68 65 20 |n2)....\| in the |
|00002f90| 57 48 4f 4c 45 20 6f 66 | 20 73 65 6c 66 2e 20 20 |WHOLE of| self. |
|00002fa0| 53 65 6c 66 20 69 73 20 | 6c 65 66 74 20 72 65 73 |Self is |left res|
|00002fb0| 65 74 2e 0d 09 72 65 73 | 65 74 3a 20 73 65 6c 66 |et...res|et: self|
|00002fc0| 0d 09 42 45 47 49 4e 20 | 20 20 61 64 64 72 31 20 |..BEGIN | addr1 |
|00002fd0| 6c 65 6e 31 20 20 73 65 | 61 72 63 68 3a 20 73 65 |len1 se|arch: se|
|00002fe0| 6c 66 0d 09 57 48 49 4c | 45 20 20 20 73 74 65 70 |lf..WHIL|E step|
|00002ff0| 3a 20 73 65 6c 66 0d 09 | 09 6c 65 6e 31 20 61 64 |: self..|.len1 ad|
|00003000| 64 72 32 20 6c 65 6e 32 | 20 20 28 72 65 70 6c 29 |dr2 len2| (repl)|
|00003010| 3a 20 73 65 6c 66 20 20 | 6e 6f 6c 69 6d 3a 20 73 |: self |nolim: s|
|00003020| 65 6c 66 0d 09 52 45 50 | 45 41 54 0d 09 63 6c 65 |elf..REP|EAT..cle|
|00003030| 61 72 3a 20 70 6f 73 0d | 3b 6d 0d 0d 5c 20 20 20 |ar: pos.|;m..\ |
|00003040| 20 20 20 20 20 20 20 20 | 20 20 20 20 3d 3d 3d 3d | | ====|
|00003050| 3d 3d 3d 3d 3d 20 4c 69 | 6e 65 2d 6f 72 69 65 6e |===== Li|ne-orien|
|00003060| 74 65 64 20 6d 65 74 68 | 6f 64 73 3a 20 3d 3d 3d |ted meth|ods: ===|
|00003070| 3d 3d 3d 3d 3d 3d 0d 0d | 5c 20 4c 49 4e 45 3e 3a |======..|\ LINE>:|
|00003080| 20 73 65 74 73 20 4c 49 | 4d 20 74 6f 20 74 68 65 | sets LI|M to the|
|00003090| 20 65 6e 64 20 6f 66 20 | 74 68 65 20 63 75 72 72 | end of |the curr|
|000030a0| 65 6e 74 20 6c 69 6e 65 | 20 28 69 2e 65 2e 20 74 |ent line| (i.e. t|
|000030b0| 68 65 20 6e 65 78 74 20 | 52 65 74 75 72 6e 0d 5c |he next |Return.\|
|000030c0| 20 63 68 61 72 61 63 74 | 65 72 2c 20 6f 72 20 74 | charact|er, or t|
|000030d0| 68 65 20 65 6e 64 20 6f | 66 20 74 68 65 20 73 74 |he end o|f the st|
|000030e0| 72 69 6e 67 29 2e 20 20 | 50 4f 53 20 69 73 6e 27 |ring). |POS isn'|
|000030f0| 74 20 6d 6f 76 65 64 20 | 2d 2d 20 69 74 20 6e 65 |t moved |-- it ne|
|00003100| 65 64 20 6e 6f 74 0d 5c | 20 62 65 20 61 74 20 74 |ed not.\| be at t|
|00003110| 68 65 20 73 74 61 72 74 | 20 6f 66 20 74 68 65 20 |he start| of the |
|00003120| 6c 69 6e 65 2e 0d 0d 3a | 6d 20 4c 49 4e 45 3e 3a |line...:|m LINE>:|
|00003130| 0d 09 6e 6f 6c 69 6d 3a | 20 73 65 6c 66 0d 09 52 |..nolim:| self..R|
|00003140| 45 54 20 63 68 73 65 61 | 72 63 68 3a 20 73 65 6c |ET chsea|rch: sel|
|00003150| 66 20 20 64 72 6f 70 20 | 20 3b 6d 0d 0d 0d 28 2a |f drop | ;m...(*|
|00003160| 09 4e 45 58 54 4c 49 4e | 45 3f 3a 20 73 65 74 73 |.NEXTLIN|E?: sets|
|00003170| 20 50 4f 53 20 61 6e 64 | 20 4c 49 4d 20 74 6f 20 | POS and| LIM to |
|00003180| 64 65 6c 69 6d 69 74 20 | 74 68 65 20 6e 65 78 74 |delimit |the next|
|00003190| 20 6c 69 6e 65 2e 20 20 | 54 68 69 73 20 6d 65 61 | line. |This mea|
|000031a0| 6e 73 20 50 4f 53 0d 09 | 77 69 6c 6c 20 70 6f 69 |ns POS..|will poi|
|000031b0| 6e 74 20 74 6f 20 74 68 | 65 20 63 68 61 72 20 61 |nt to th|e char a|
|000031c0| 66 74 65 72 20 74 68 65 | 20 52 65 74 75 72 6e 20 |fter the| Return |
|000031d0| 63 68 61 72 61 63 74 65 | 72 2c 20 6f 72 20 74 6f |characte|r, or to|
|000031e0| 20 74 68 65 20 66 69 72 | 73 74 0d 09 63 68 61 72 | the fir|st..char|
|000031f0| 20 6f 66 20 74 68 65 20 | 73 74 72 69 6e 67 2c 20 | of the |string, |
|00003200| 61 6e 64 20 4c 49 4d 20 | 77 69 6c 6c 20 70 6f 69 |and LIM |will poi|
|00003210| 6e 74 20 74 6f 20 74 68 | 65 20 6e 65 78 74 20 52 |nt to th|e next R|
|00003220| 65 74 75 72 6e 2c 20 6f | 72 20 74 6f 20 31 0d 09 |eturn, o|r to 1..|
|00003230| 70 61 73 74 20 74 68 65 | 20 65 6e 64 20 6f 66 20 |past the| end of |
|00003240| 74 68 65 20 73 74 72 69 | 6e 67 2e 20 20 49 66 20 |the stri|ng. If |
|00003250| 4c 49 4d 20 69 6e 69 74 | 69 61 6c 6c 79 20 64 6f |LIM init|ially do|
|00003260| 65 73 20 6e 6f 74 20 70 | 6f 69 6e 74 20 74 6f 20 |es not p|oint to |
|00003270| 61 0d 09 52 65 74 75 72 | 6e 20 63 68 61 72 61 63 |a..Retur|n charac|
|00003280| 74 65 72 2c 20 74 68 65 | 20 22 6e 65 78 74 22 20 |ter, the| "next" |
|00003290| 6c 69 6e 65 20 77 69 6c | 6c 20 61 63 74 75 61 6c |line wil|l actual|
|000032a0| 6c 79 20 62 65 20 74 68 | 65 20 72 65 73 74 20 6f |ly be th|e rest o|
|000032b0| 66 20 74 68 65 0d 09 63 | 75 72 72 65 6e 74 20 6f |f the..c|urrent o|
|000032c0| 6e 65 2c 20 73 74 61 72 | 74 69 6e 67 20 66 72 6f |ne, star|ting fro|
|000032d0| 6d 20 77 68 65 72 65 20 | 4c 49 4d 20 70 6f 69 6e |m where |LIM poin|
|000032e0| 74 65 64 2e 20 20 54 68 | 69 73 20 62 65 68 61 76 |ted. Th|is behav|
|000032f0| 69 6f 72 20 6d 65 61 6e | 73 0d 09 74 68 61 74 20 |ior mean|s..that |
|00003300| 69 66 20 50 4f 53 20 61 | 6e 64 20 4c 49 4d 20 61 |if POS a|nd LIM a|
|00003310| 72 65 20 69 6e 69 74 69 | 61 6c 6c 79 20 7a 65 72 |re initi|ally zer|
|00003320| 6f 2c 20 63 61 6c 6c 69 | 6e 67 20 4e 45 58 54 4c |o, calli|ng NEXTL|
|00003330| 49 4e 45 3f 3a 20 77 69 | 6c 6c 0d 09 61 63 74 75 |INE?: wi|ll..actu|
|00003340| 61 6c 6c 79 20 79 69 65 | 6c 64 20 74 68 65 20 66 |ally yie|ld the f|
|00003350| 69 72 73 74 20 6c 69 6e | 65 2e 20 20 20 54 68 69 |irst lin|e. Thi|
|00003360| 73 20 63 61 6e 20 62 65 | 20 75 73 65 66 75 6c 2e |s can be| useful.|
|00003370| 20 20 54 68 65 20 72 65 | 74 75 72 6e 65 64 0d 09 | The re|turned..|
|00003380| 62 6f 6f 6c 65 61 6e 20 | 69 73 20 74 72 75 65 20 |boolean |is true |
|00003390| 69 66 20 77 65 20 61 63 | 74 75 61 6c 6c 79 20 67 |if we ac|tually g|
|000033a0| 65 74 20 61 6e 6f 74 68 | 65 72 20 6c 69 6e 65 2c |et anoth|er line,|
|000033b0| 20 61 6e 64 20 66 61 6c | 73 65 20 69 66 20 77 65 | and fal|se if we|
|000033c0| 0d 09 64 6f 6e 27 74 2c | 20 74 68 61 74 20 69 73 |..don't,| that is|
|000033d0| 2c 20 69 66 20 4c 49 4d | 20 77 61 73 20 69 6e 69 |, if LIM| was ini|
|000033e0| 74 69 61 6c 6c 79 20 61 | 74 20 74 68 65 20 65 6e |tially a|t the en|
|000033f0| 64 20 6f 66 20 74 68 65 | 20 73 74 72 69 6e 67 2e |d of the| string.|
|00003400| 0d 09 4e 6f 74 65 20 74 | 68 61 74 20 69 66 20 74 |..Note t|hat if t|
|00003410| 68 65 20 73 74 72 69 6e | 67 20 65 6e 64 73 20 77 |he strin|g ends w|
|00003420| 69 74 68 20 61 20 52 65 | 74 75 72 6e 20 63 68 61 |ith a Re|turn cha|
|00003430| 72 61 63 74 65 72 2c 20 | 61 6e 64 20 4c 49 4d 20 |racter, |and LIM |
|00003440| 70 6f 69 6e 74 73 0d 09 | 74 6f 20 74 68 69 73 20 |points..|to this |
|00003450| 63 68 61 72 61 63 74 65 | 72 20 77 68 65 6e 20 6e |characte|r when n|
|00003460| 65 78 74 6c 69 6e 65 3f | 3a 20 69 73 20 63 61 6c |extline?|: is cal|
|00003470| 6c 65 64 2c 20 74 68 69 | 73 20 69 73 20 6e 6f 74 |led, thi|s is not|
|00003480| 20 74 68 65 20 73 61 6d | 65 20 61 73 0d 09 4c 49 | the sam|e as..LI|
|00003490| 4d 20 70 6f 69 6e 74 69 | 6e 67 20 74 6f 20 31 20 |M pointi|ng to 1 |
|000034a0| 70 61 73 74 20 74 68 65 | 20 65 6e 64 20 6f 66 20 |past the| end of |
|000034b0| 74 68 65 20 73 74 72 69 | 6e 67 2c 20 77 68 69 63 |the stri|ng, whic|
|000034c0| 68 20 69 73 20 69 74 73 | 20 72 65 61 6c 20 22 65 |h is its| real "e|
|000034d0| 6e 64 0d 09 6f 66 20 73 | 74 72 69 6e 67 22 20 76 |nd..of s|tring" v|
|000034e0| 61 6c 75 65 2e 20 20 54 | 68 75 73 20 6e 65 78 74 |alue. T|hus next|
|000034f0| 6c 69 6e 65 3f 3a 20 77 | 69 6c 6c 20 72 65 74 75 |line?: w|ill retu|
|00003500| 72 6e 20 74 72 75 65 20 | 77 69 74 68 20 61 6e 20 |rn true |with an |
|00003510| 65 6d 70 74 79 20 6c 69 | 6e 65 2e 0d 09 54 68 65 |empty li|ne...The|
|00003520| 20 6e 65 78 74 20 63 61 | 6c 6c 20 77 69 6c 6c 20 | next ca|ll will |
|00003530| 72 65 74 75 72 6e 20 66 | 61 6c 73 65 2e 20 0d 2a |return f|alse. .*|
|00003540| 29 0d 0d 3a 6d 20 4e 45 | 58 54 4c 49 4e 45 3f 3a |)..:m NE|XTLINE?:|
|00003550| 0d 09 73 74 65 70 3a 20 | 73 65 6c 66 20 20 6c 65 |..step: |self le|
|00003560| 6e 3a 20 73 65 6c 66 20 | 20 4e 49 46 20 20 66 61 |n: self | NIF fa|
|00003570| 6c 73 65 20 20 45 58 49 | 54 20 20 54 48 45 4e 0d |lse EXI|T THEN.|
|00003580| 09 31 73 74 3a 20 73 65 | 6c 66 20 20 52 45 54 20 |.1st: se|lf RET |
|00003590| 3d 20 20 6e 65 67 61 74 | 65 20 73 6b 69 70 3a 20 |= negat|e skip: |
|000035a0| 73 65 6c 66 0d 09 52 45 | 54 20 63 68 73 65 61 72 |self..RE|T chsear|
|000035b0| 63 68 3a 20 73 65 6c 66 | 20 20 64 72 6f 70 20 20 |ch: self| drop |
|000035c0| 74 72 75 65 0d 3b 6d 0d | 0d 0d 5c 20 54 68 65 20 |true.;m.|..\ The |
|000035d0| 72 65 76 65 72 73 65 20 | 6f 70 65 72 61 74 69 6f |reverse |operatio|
|000035e0| 6e 20 69 73 20 61 20 62 | 69 74 20 65 61 73 69 65 |n is a b|it easie|
|000035f0| 72 20 62 65 63 61 75 73 | 65 20 77 65 20 64 6f 6e |r becaus|e we don|
|00003600| 27 74 20 6e 65 65 64 20 | 74 6f 20 63 68 65 63 6b |'t need |to check|
|00003610| 0d 5c 20 69 66 20 50 4f | 53 20 69 73 20 69 6e 69 |.\ if PO|S is ini|
|00003620| 74 69 61 6c 6c 79 20 70 | 6f 69 6e 74 69 6e 67 20 |tially p|ointing |
|00003630| 61 74 20 61 20 52 65 74 | 75 72 6e 2e 0d 0d 3a 6d |at a Ret|urn...:m|
|00003640| 20 3c 4e 45 58 54 4c 49 | 4e 45 3f 3a 0d 09 3c 73 | <NEXTLI|NE?:..<s|
|00003650| 74 65 70 3a 20 73 65 6c | 66 0d 09 6c 65 6e 3a 20 |tep: sel|f..len: |
|00003660| 73 65 6c 66 20 20 4e 49 | 46 20 20 66 61 6c 73 65 |self NI|F false|
|00003670| 20 20 45 58 49 54 20 20 | 54 48 45 4e 0d 09 52 45 | EXIT |THEN..RE|
|00003680| 54 20 20 3c 63 68 73 65 | 61 72 63 68 3a 20 73 65 |T <chse|arch: se|
|00003690| 6c 66 20 20 64 72 6f 70 | 20 20 74 72 75 65 0d 3b |lf drop| true.;|
|000036a0| 6d 0d 0d 0d 3a 6d 20 41 | 44 44 4c 49 4e 45 3a 20 |m...:m A|DDLINE: |
|000036b0| 20 20 20 20 20 20 20 20 | 20 20 20 20 5c 20 28 20 | | \ ( |
|000036c0| 61 64 64 72 20 6c 65 6e | 20 2d 2d 20 29 0d 09 61 |addr len| -- )..a|
|000036d0| 64 64 3a 20 73 65 6c 66 | 0d 09 67 65 74 3a 20 73 |dd: self|..get: s|
|000036e0| 69 7a 65 0d 09 69 66 20 | 20 20 20 5e 31 73 74 3a |ize..if | ^1st:|
|000036f0| 20 73 65 6c 66 20 31 2d | 20 63 40 20 20 52 45 54 | self 1-| c@ RET|
|00003700| 20 3d 20 20 20 65 6c 73 | 65 20 20 20 20 66 61 6c | = els|e fal|
|00003710| 73 65 20 20 20 20 74 68 | 65 6e 20 20 20 20 3f 65 |se th|en ?e|
|00003720| 78 69 74 0d 09 52 45 54 | 20 20 2b 3a 20 73 65 6c |xit..RET| +: sel|
|00003730| 66 20 20 3b 6d 0d 0d 3a | 6d 20 24 41 44 44 4c 49 |f ;m..:|m $ADDLI|
|00003740| 4e 45 3a 20 20 7b 20 73 | 74 72 20 5c 20 73 74 61 |NE: { s|tr \ sta|
|00003750| 74 65 20 2d 2d 20 7d 0d | 09 73 74 72 20 67 65 74 |te -- }.|.str get|
|00003760| 53 74 61 74 65 3a 20 63 | 6c 61 73 73 5f 61 73 3e |State: c|lass_as>|
|00003770| 20 73 74 72 69 6e 67 20 | 20 2d 3e 20 73 74 61 74 | string | -> stat|
|00003780| 65 20 20 73 74 72 20 6c | 6f 63 6b 3a 20 73 74 72 |e str l|ock: str|
|00003790| 69 6e 67 0d 09 73 74 72 | 20 67 65 74 3a 20 63 6c |ing..str| get: cl|
|000037a0| 61 73 73 5f 61 73 3e 20 | 73 74 72 69 6e 67 20 20 |ass_as> |string |
|000037b0| 61 64 64 6c 69 6e 65 3a | 20 73 65 6c 66 0d 09 73 |addline:| self..s|
|000037c0| 74 61 74 65 20 20 73 74 | 72 20 73 65 74 53 74 61 |tate st|r setSta|
|000037d0| 74 65 3a 20 63 6c 61 73 | 73 5f 61 73 3e 20 73 74 |te: clas|s_as> st|
|000037e0| 72 69 6e 67 20 20 3b 6d | 0d 0d 0d 0d 5c 20 20 20 |ring ;m|....\ |
|000037f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 3d 3d 3d 3d | | ====|
|00003800| 3d 3d 3d 3d 3d 3d 3d 20 | 49 2f 4f 20 6f 70 65 72 |======= |I/O oper|
|00003810| 61 74 69 6f 6e 73 3a 20 | 3d 3d 3d 3d 3d 3d 3d 3d |ations: |========|
|00003820| 3d 3d 3d 3d 0d 20 0d 3a | 6d 20 52 45 41 44 4e 3a |====. .:|m READN:|
|00003830| 20 20 7b 20 66 63 62 20 | 6e 20 5c 20 73 74 61 74 | { fcb |n \ stat|
|00003840| 65 20 2d 2d 20 7d 0d 09 | 09 09 5c 20 52 65 61 64 |e -- }..|..\ Read|
|00003850| 73 20 6e 20 62 79 74 65 | 73 20 66 72 6f 6d 20 74 |s n byte|s from t|
|00003860| 68 65 20 67 69 76 65 6e | 20 66 69 6c 65 0d 09 09 |he given| file...|
|00003870| 09 5c 20 69 6e 74 6f 20 | 53 45 4c 46 2c 20 63 6f |.\ into |SELF, co|
|00003880| 6d 70 6c 65 74 65 6c 79 | 20 72 65 70 6c 61 63 69 |mpletely| replaci|
|00003890| 6e 67 20 77 68 61 74 65 | 76 65 72 20 77 61 73 20 |ng whate|ver was |
|000038a0| 74 68 65 72 65 20 62 65 | 66 6f 72 65 2e 0d 09 09 |there be|fore....|
|000038b0| 09 5c 20 54 68 65 20 72 | 65 61 64 20 73 74 6f 70 |.\ The r|ead stop|
|000038c0| 73 20 77 68 65 6e 20 65 | 6e 64 20 66 69 6c 65 20 |s when e|nd file |
|000038d0| 69 73 20 72 65 61 63 68 | 65 64 2e 0d 09 6e 20 73 |is reach|ed...n s|
|000038e0| 65 74 73 69 7a 65 3a 20 | 73 65 6c 66 0d 09 67 65 |etsize: |self..ge|
|000038f0| 74 53 74 61 74 65 3a 20 | 73 65 6c 66 20 20 2d 3e |tState: |self ->|
|00003900| 20 73 74 61 74 65 20 20 | 6c 6f 63 6b 3a 20 73 65 | state |lock: se|
|00003910| 6c 66 0d 09 61 6c 6c 3a | 20 73 65 6c 66 20 20 66 |lf..all:| self f|
|00003920| 63 62 20 72 65 61 64 3a | 20 63 6c 61 73 73 5f 61 |cb read:| class_a|
|00003930| 73 3e 20 66 69 6c 65 0d | 09 73 74 61 74 65 20 20 |s> file.|.state |
|00003940| 73 65 74 53 74 61 74 65 | 3a 20 73 65 6c 66 0d 09 |setState|: self..|
|00003950| 64 75 70 20 2d 33 39 20 | 3d 20 20 49 46 20 20 64 |dup -39 |= IF d|
|00003960| 72 6f 70 20 20 30 20 20 | 54 48 45 4e 20 20 4f 4b |rop 0 |THEN OK|
|00003970| 3f 09 5c 20 57 65 20 64 | 6f 6e 27 74 20 77 6f 72 |?.\ We d|on't wor|
|00003980| 72 79 20 69 66 20 74 68 | 65 20 65 72 72 6f 72 0d |ry if th|e error.|
|00003990| 09 09 09 09 09 09 09 09 | 09 09 5c 20 20 77 61 73 |........|..\ was|
|000039a0| 20 65 6e 64 66 69 6c 65 | 0d 09 66 63 62 20 62 79 | endfile|..fcb by|
|000039b0| 74 65 73 52 65 61 64 3a | 20 63 6c 61 73 73 5f 61 |tesRead:| class_a|
|000039c0| 73 3e 20 66 69 6c 65 20 | 20 73 65 74 53 69 7a 65 |s> file | setSize|
|000039d0| 3a 20 73 65 6c 66 20 20 | 3b 6d 0d 0d 0d 3a 6d 20 |: self |;m...:m |
|000039e0| 52 45 41 44 4c 49 4e 45 | 3f 3a 20 20 7b 20 66 63 |READLINE|?: { fc|
|000039f0| 62 20 6e 20 5c 20 73 74 | 61 74 65 20 2d 2d 20 62 |b n \ st|ate -- b|
|00003a00| 20 7d 0d 09 09 09 09 5c | 20 52 65 61 64 73 20 74 | }.....\| Reads t|
|00003a10| 68 65 20 6e 65 78 74 20 | 6c 69 6e 65 20 75 70 20 |he next |line up |
|00003a20| 74 6f 20 61 20 6d 61 78 | 20 6f 66 20 6e 20 63 68 |to a max| of n ch|
|00003a30| 61 72 73 2e 0d 09 09 09 | 09 5c 20 52 65 74 75 72 |ars.....|.\ Retur|
|00003a40| 6e 73 20 66 61 6c 73 65 | 20 69 66 20 65 6e 64 20 |ns false| if end |
|00003a50| 6f 66 20 66 69 6c 65 2e | 20 20 44 6f 65 73 20 6e |of file.| Does n|
|00003a60| 6f 74 0d 09 09 09 09 5c | 20 69 6e 63 6c 75 64 65 |ot.....\| include|
|00003a70| 20 74 68 65 20 66 69 6e | 61 6c 20 52 65 74 75 72 | the fin|al Retur|
|00003a80| 6e 20 63 68 61 72 2e 0d | 09 6e 20 73 65 74 73 69 |n char..|.n setsi|
|00003a90| 7a 65 3a 20 73 65 6c 66 | 0d 09 67 65 74 53 74 61 |ze: self|..getSta|
|00003aa0| 74 65 3a 20 73 65 6c 66 | 20 20 2d 3e 20 73 74 61 |te: self| -> sta|
|00003ab0| 74 65 20 20 6c 6f 63 6b | 3a 20 73 65 6c 66 0d 09 |te lock|: self..|
|00003ac0| 61 6c 6c 3a 20 73 65 6c | 66 20 20 66 63 62 20 72 |all: sel|f fcb r|
|00003ad0| 65 61 64 6c 69 6e 65 3a | 20 63 6c 61 73 73 5f 61 |eadline:| class_a|
|00003ae0| 73 3e 20 66 69 6c 65 0d | 09 73 74 61 74 65 20 20 |s> file.|.state |
|00003af0| 73 65 74 53 74 61 74 65 | 3a 20 73 65 6c 66 0d 09 |setState|: self..|
|00003b00| 64 75 70 0d 09 4e 49 46 | 09 09 5c 20 53 75 63 63 |dup..NIF|..\ Succ|
|00003b10| 65 73 73 2e 20 20 41 73 | 73 75 6d 65 20 77 65 20 |ess. As|sume we |
|00003b20| 67 6f 74 20 61 20 52 65 | 74 75 72 6e 0d 09 09 64 |got a Re|turn...d|
|00003b30| 72 6f 70 20 20 66 63 62 | 20 62 79 74 65 73 52 65 |rop fcb| bytesRe|
|00003b40| 61 64 3a 20 63 6c 61 73 | 73 5f 61 73 3e 20 66 69 |ad: clas|s_as> fi|
|00003b50| 6c 65 20 31 2d 20 20 73 | 65 74 53 69 7a 65 3a 20 |le 1- s|etSize: |
|00003b60| 73 65 6c 66 0d 09 09 74 | 72 75 65 20 20 65 78 69 |self...t|rue exi|
|00003b70| 74 0d 09 54 48 45 4e 0d | 09 64 75 70 20 45 4f 46 |t..THEN.|.dup EOF|
|00003b80| 20 3d 0d 09 49 46 09 09 | 5c 20 52 65 74 75 72 6e | =..IF..|\ Return|
|00003b90| 20 54 72 75 65 20 69 66 | 20 77 65 20 67 6f 74 20 | True if| we got |
|00003ba0| 61 6e 79 20 62 79 74 65 | 73 20 61 74 20 61 6c 6c |any byte|s at all|
|00003bb0| 0d 09 09 64 72 6f 70 20 | 20 66 63 62 20 62 79 74 |...drop | fcb byt|
|00003bc0| 65 73 52 65 61 64 3a 20 | 63 6c 61 73 73 5f 61 73 |esRead: |class_as|
|00003bd0| 3e 20 66 69 6c 65 20 20 | 64 75 70 20 20 73 65 74 |> file |dup set|
|00003be0| 53 69 7a 65 3a 20 73 65 | 6c 66 0d 09 09 30 3c 3e |Size: se|lf...0<>|
|00003bf0| 20 20 45 58 49 54 0d 09 | 54 48 45 4e 0d 20 28 20 | EXIT..|THEN. ( |
|00003c00| 46 69 6c 65 20 65 72 72 | 6f 72 20 2d 20 63 61 75 |File err|or - cau|
|00003c10| 73 65 20 65 72 72 6f 72 | 20 68 61 6e 64 6c 65 72 |se error| handler|
|00003c20| 20 74 6f 20 65 78 65 63 | 75 74 65 20 29 20 20 4f | to exec|ute ) O|
|00003c30| 4b 3f 0d 3b 6d 0d 0d 0d | 3a 6d 20 52 45 41 44 52 |K?.;m...|:m READR|
|00003c40| 45 53 54 3a 20 20 7b 20 | 66 63 62 20 2d 2d 20 7d |EST: { |fcb -- }|
|00003c50| 0d 09 09 09 09 5c 20 52 | 65 61 64 73 20 61 6c 6c |.....\ R|eads all|
|00003c60| 20 74 68 65 20 72 65 6d | 61 69 6e 64 65 72 20 6f | the rem|ainder o|
|00003c70| 66 20 74 68 65 20 67 69 | 76 65 6e 20 66 69 6c 65 |f the gi|ven file|
|00003c80| 20 69 6e 74 6f 20 53 45 | 4c 46 2e 0d 09 66 63 62 | into SE|LF...fcb|
|00003c90| 20 20 66 63 62 20 73 69 | 7a 65 3a 20 63 6c 61 73 | fcb si|ze: clas|
|00003ca0| 73 5f 61 73 3e 20 66 69 | 6c 65 20 20 72 65 61 64 |s_as> fi|le read|
|00003cb0| 6e 3a 20 73 65 6c 66 20 | 20 3b 6d 0d 0d 0d 3a 6d |n: self | ;m...:m|
|00003cc0| 20 52 45 41 44 41 4c 4c | 3a 20 20 7b 20 66 63 62 | READALL|: { fcb|
|00003cd0| 20 2d 2d 20 7d 20 20 20 | 20 20 20 20 20 20 5c 20 | -- } | \ |
|00003ce0| 52 65 61 64 73 20 61 6c | 6c 20 74 68 65 20 67 69 |Reads al|l the gi|
|00003cf0| 76 65 6e 20 66 69 6c 65 | 20 69 6e 74 6f 20 53 45 |ven file| into SE|
|00003d00| 4c 46 2e 0d 09 30 20 20 | 66 63 62 20 6d 6f 76 65 |LF...0 |fcb move|
|00003d10| 74 6f 3a 20 63 6c 61 73 | 73 5f 61 73 3e 20 66 69 |to: clas|s_as> fi|
|00003d20| 6c 65 20 20 4f 4b 3f 20 | 20 66 63 62 20 72 65 61 |le OK? | fcb rea|
|00003d30| 64 52 65 73 74 3a 20 73 | 65 6c 66 20 20 3b 6d 0d |dRest: s|elf ;m.|
|00003d40| 0d 0d 3a 6d 20 52 45 41 | 44 54 4f 50 3a 09 09 5c |..:m REA|DTOP:..\|
|00003d50| 20 52 65 61 64 73 20 61 | 6c 6c 20 6f 66 20 54 4f | Reads a|ll of TO|
|00003d60| 50 46 49 4c 45 20 69 6e | 74 6f 20 53 45 4c 46 2c |PFILE in|to SELF,|
|00003d70| 20 74 68 65 6e 20 63 6c | 6f 73 65 73 20 61 6e 64 | then cl|oses and|
|00003d80| 0d 20 09 09 09 09 5c 20 | 64 72 6f 70 73 20 54 4f |. ....\ |drops TO|
|00003d90| 50 46 49 4c 45 2e 20 20 | 54 4f 50 46 49 4c 45 20 |PFILE. |TOPFILE |
|00003da0| 6d 75 73 74 20 61 6c 72 | 65 61 64 79 20 62 65 20 |must alr|eady be |
|00003db0| 6f 70 65 6e 2e 0d 09 74 | 6f 70 66 69 6c 65 20 20 |open...t|opfile |
|00003dc0| 72 65 61 64 41 6c 6c 3a | 20 73 65 6c 66 0d 09 63 |readAll:| self..c|
|00003dd0| 6c 6f 73 65 3a 20 74 6f | 70 66 69 6c 65 20 20 4f |lose: to|pfile O|
|00003de0| 4b 3f 20 20 64 72 6f 70 | 3a 20 6c 6f 61 64 66 69 |K? drop|: loadfi|
|00003df0| 6c 65 20 20 3b 6d 0d 0d | 0d 3a 6d 20 24 57 52 49 |le ;m..|.:m $WRI|
|00003e00| 54 45 3a 20 20 7b 20 66 | 63 62 20 2d 2d 20 7d 0d |TE: { f|cb -- }.|
|00003e10| 09 67 65 74 3a 20 73 65 | 6c 66 20 20 66 63 62 20 |.get: se|lf fcb |
|00003e20| 77 72 69 74 65 3a 20 63 | 6c 61 73 73 5f 61 73 3e |write: c|lass_as>|
|00003e30| 20 66 69 6c 65 20 20 4f | 4b 3f 20 20 3b 6d 0d 0d | file O|K? ;m..|
|00003e40| 0d 3a 6d 20 44 52 41 57 | 3a 20 20 7b 20 74 52 65 |.:m DRAW|: { tRe|
|00003e50| 63 74 20 6a 75 73 74 20 | 2d 2d 20 7d 20 20 5c 20 |ct just |-- } \ |
|00003e60| 44 72 61 77 73 20 74 68 | 65 20 73 74 72 69 6e 67 |Draws th|e string|
|00003e70| 20 6a 75 73 74 69 66 69 | 65 64 20 69 6e 20 72 65 | justifi|ed in re|
|00003e80| 63 74 20 74 52 65 63 74 | 2e 0d 09 67 65 74 3a 20 |ct tRect|...get: |
|00003e90| 73 65 6c 66 0d 09 74 52 | 65 63 74 20 20 6a 75 73 |self..tR|ect jus|
|00003ea0| 74 20 20 54 45 54 65 78 | 74 42 6f 78 20 20 3b 6d |t TETex|tBox ;m|
|00003eb0| 0d 0d 0d 3a 6d 20 50 52 | 49 4e 54 41 4c 4c 3a 20 |...:m PR|INTALL: |
|00003ec0| 20 20 7b 20 5c 20 73 76 | 50 6f 73 20 73 76 4c 69 | { \ sv|Pos svLi|
|00003ed0| 6d 20 73 76 43 75 72 73 | 20 31 73 74 3f 20 2d 2d |m svCurs| 1st? --|
|00003ee0| 20 7d 0d 09 6e 69 6c 3f | 3a 20 73 65 6c 66 20 20 | }..nil?|: self |
|00003ef0| 49 46 20 20 4e 6f 70 65 | 6e 20 20 45 58 49 54 20 |IF Nope|n EXIT |
|00003f00| 20 54 48 45 4e 0d 09 67 | 65 74 3a 20 70 6f 73 20 | THEN..g|et: pos |
|00003f10| 20 2d 3e 20 73 76 50 6f | 73 20 20 67 65 74 3a 20 | -> svPo|s get: |
|00003f20| 6c 69 6d 20 20 2d 3e 20 | 73 76 4c 69 6d 0d 09 63 |lim -> |svLim..c|
|00003f30| 75 72 73 3f 20 2d 3e 20 | 73 76 43 75 72 73 20 20 |urs? -> |svCurs |
|00003f40| 2d 63 75 72 73 0d 09 62 | 65 67 69 6e 3a 20 73 65 |-curs..b|egin: se|
|00003f50| 6c 66 20 20 74 72 75 65 | 20 2d 3e 20 31 73 74 3f |lf true| -> 1st?|
|00003f60| 0d 09 42 45 47 49 4e 20 | 20 20 6e 65 78 74 6c 69 |..BEGIN | nextli|
|00003f70| 6e 65 3f 3a 20 73 65 6c | 66 0d 09 57 48 49 4c 45 |ne?: sel|f..WHILE|
|00003f80| 09 67 65 74 3a 20 73 65 | 6c 66 20 20 74 79 70 65 |.get: se|lf type|
|00003f90| 0d 09 09 09 31 73 74 3f | 20 49 46 20 20 66 61 6c |....1st?| IF fal|
|00003fa0| 73 65 20 2d 3e 20 31 73 | 74 3f 20 20 45 4c 53 45 |se -> 1s|t? ELSE|
|00003fb0| 20 20 63 72 20 20 30 20 | 2d 3e 20 6f 75 74 20 20 | cr 0 |-> out |
|00003fc0| 54 48 45 4e 0d 09 52 45 | 50 45 41 54 0d 09 73 76 |THEN..RE|PEAT..sv|
|00003fd0| 50 6f 73 20 20 70 75 74 | 3a 20 70 6f 73 20 20 73 |Pos put|: pos s|
|00003fe0| 76 4c 69 6d 20 20 70 75 | 74 3a 20 6c 69 6d 0d 09 |vLim pu|t: lim..|
|00003ff0| 73 76 43 75 72 73 20 2d | 3e 20 63 75 72 73 3f 20 |svCurs -|> curs? |
|00004000| 20 3b 6d 0d 0d 3b 63 6c | 61 73 73 0d 00 00 00 00 | ;m..;cl|ass.....|
|00004010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004040| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004050| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004060| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004070| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00004080| 00 00 01 00 00 00 01 42 | 00 00 00 42 00 00 00 3b |.......B|...B...;|
|00004090| 39 38 3a 20 52 65 73 6f | 75 72 63 65 20 61 74 74 |98: Reso|urce att|
|000040a0| 72 69 62 75 74 65 20 69 | 6e 63 6f 6e 73 69 73 74 |ribute i|nconsist|
|000040b0| 08 7a 53 74 72 69 6e 67 | 2b 74 02 00 00 00 50 61 |.zString|+t....Pa|
|000040c0| 72 74 53 49 54 21 00 00 | 00 00 00 00 00 00 00 01 |rtSIT!..|........|
|000040d0| 00 00 50 61 72 74 53 49 | 54 21 00 00 00 00 00 00 |..PartSI|T!......|
|000040e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000040f0| 00 00 b3 66 c2 79 00 00 | 00 00 00 00 01 7d 00 00 |...f.y..|.....}..|
|00004100| b0 00 00 00 20 00 00 3f | 3c 00 01 a9 f0 00 00 3f |.... ..?|<......?|
|00004110| 3c 00 02 a9 f0 00 00 3f | 3c 00 03 a9 f0 00 00 3f |<......?|<......?|
|00004120| 3c 00 04 a9 f0 00 00 3f | 3c 00 05 a9 f0 00 00 3f |<......?|<......?|
|00004130| 3c 00 06 a9 f0 00 00 3f | 3c 00 07 a9 f0 00 00 3f |<......?|<......?|
|00004140| 3c 00 08 a9 f0 00 00 3f | 3c 00 09 a9 f0 00 00 3f |<......?|<......?|
|00004150| 3c 00 0a a9 f0 00 00 3f | 3c 00 0b a9 f0 00 00 3f |<......?|<......?|
|00004160| 3c 00 0c a9 f0 00 00 3f | 3c 00 0d a9 f0 00 00 3f |<......?|<......?|
|00004170| 3c 00 0e a9 f0 00 00 3f | 3c 00 0f a9 f0 00 00 3f |<......?|<......?|
|00004180| 00 00 00 3e 00 00 b7 65 | 00 00 32 25 00 00 3e bf |...>...e|..2%..>.|
|00004190| 00 00 b6 55 00 00 00 00 | 00 00 93 c4 00 00 ca 06 |...U....|........|
|000041a0| 00 00 d2 cc 00 00 da 4f | 00 00 37 6b 00 00 3f 8c |.......O|..7k..?.|
|000041b0| 00 00 3f 8c 00 00 00 00 | 00 00 00 00 00 00 00 00 |..?.....|........|
|000041c0| 00 00 00 00 01 00 00 00 | 01 42 00 00 00 42 00 00 |........|.B...B..|
|000041d0| 00 3b 02 66 31 98 25 d4 | 00 00 00 1c 00 32 00 00 |.;.f1.%.|.....2..|
|000041e0| 4d 49 46 4f 00 00 00 0a | 00 80 00 00 00 00 00 00 |MIFO....|........|
|000041f0| 02 66 39 60 08 4d 69 73 | 63 49 6e 66 6f 00 00 00 |.f9`.Mis|cInfo...|
+--------+-------------------------+-------------------------+--------+--------+