diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-02-24 13:34:10 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2013-02-24 13:34:10 +0100 |
commit | e3ea9032f6e3105d9c0a720db8bc413b4a3e016f (patch) | |
tree | 8959b4c197a16f034756574501e75bf5450e17c5 /src/symbols-extract.tes | |
parent | f5253185aa55a46cb3da80f66e7127a45c82052f (diff) | |
download | sciteco-e3ea9032f6e3105d9c0a720db8bc413b4a3e016f.tar.gz |
moved QuickSort macros from symbols-extract script into own string.tes macro library
* therefore for bootstrapping to work, the SCITECOPATH is always set explicitly
Diffstat (limited to 'src/symbols-extract.tes')
-rwxr-xr-x | src/symbols-extract.tes | 44 |
1 files changed, 1 insertions, 43 deletions
diff --git a/src/symbols-extract.tes b/src/symbols-extract.tes index 48d749c..6e09380 100755 --- a/src/symbols-extract.tes +++ b/src/symbols-extract.tes @@ -1,49 +1,7 @@ #!./sciteco-minimal -m ! ./symbols-extract.tes <input file> <output file> <prefix pattern list> <array name> ! -! <pos1,pos2>M{symcasecmp} - Compare symbol at pos1 with symbol at pos2 (caseless) ! -@{symcasecmp}{ - U.2U.1 -.%.1 -.%.2 - @.#lo{ - U.v Q.v"W a-A%.v | Q.v"CQ.v|0' ' - } - <Q.1A:M.#loU.a Q.2A:M.#loU.b - Q.a-Q.bU.c Q.c"N;' -Q.a; - %.1%.2> - Q.c -} - -! <i,j>M{exchange} - Exchange line at I with line at J (I < J), returning new J ! -@{exchange}{ - U.jU.i - Q.jJ X.xK - Q.iJ G.x .-Q.i%.j .-(X.xL.)%.j -K - Q.jJ G.x - Q.j -} - -! <i,j>M{qsort} - Sort lines beginning at I until J using Quicksort algorithm ! -@{qsort}{ - U.rU.l - - Q.l-Q.r"< - Q.lU.i Q.rJB .U.j - - < - Q.iJ <.,Q.rM{symcasecmp}-1; .-Q.r; L> .U.i - Q.jJ <.,Q.rM{symcasecmp}:; .-Q.l-1:; B> .U.j - - Q.i-Q.j; - - Q.i,Q.jM{exchange}U.j - > - - Q.i,Q.rM{symcasecmp}"> Q.i,Q.rM{exchange}U.r ' - - Q.l-Q.i"< Q.iJB Q.l,.M{qsort} ' - Q.i-Q.r"< Q.iJL .,Q.rM{qsort} ' - ' -} +[.m EQ.mQ{$SCITECOPATH}/string.tes M.m ].m ! read commandline arguments ! LR 0X#in 2LR 0X#ou 2LR 0X#pa 2LR 0X#na HK |