(defconst top-end-of-file 0) (defconst top-start-node 1) (defconst top-start-node-first 2) (defconst top-start-node-last 72) (defconst top-terminal-text-node 73) (defconst top-terminal-text-node-first 74) (defconst top-terminal-text-node-last 144) (defconst top-other-node 145) (defconst top-other-node-short 146) (defconst top-other-node-specs 147) (defconst top-other-node-specs-short 148) (defconst top-prop 149) (defconst top-prop-short 150) (defconst top-end-node 151) (defconst top-rope 152) (defconst top-comment 153) (defconst top-runs 154) (defconst top-looks 155) (defconst top-looks-first 156) (defconst top-looks-last 206) (defconst top-look1 207) (defconst top-look2 208) (defconst top-look3 209) (defconst tioga_LenLen 4) (defconst tioga_IDLen 2) (defconst tioga_CommentHeaderLen (+ tioga_IDLen tioga_LenLen)) (defconst tioga_ControlHeaderLen (+ tioga_IDLen tioga_LenLen)) (defconst tioga_TrailerLen (+ tioga_IDLen (* 3 tioga_LenLen))) (defconst trailer-id "") (defconst comment-id "") (defconst control-id "") (defvar tioga-text-next) (defvar tioga-text-limit) (defvar tioga-comment-next) (defvar tioga-comment-limit) (defvar tioga-control-next) (defvar tioga-control-limit) (defvar tioga-sum-limits) (defvar tioga-sum-size) (defvar tioga-progress-factor) (defun tioga-walk-buffer (tioga-start-node tioga-handle-prop tioga-add-looks tioga-insert-text tioga-end-node) (byte-code "  Z\\ \" ! \\! \\!U?4 V4V:!\\ \"!  # \"  !   #U?o!ډ\\\\ # \\ Z\\#  #V\"ډ ,." [buffer-len t-base tioga_TrailerLen t-start trailer-id prop-len text-len total-len comment-start comment-id comment-len control-start control-id control-len tioga-text-next tioga-text-limit tioga-comment-next tioga_LenLen tioga-comment-limit tioga-control-next tioga-control-limit tioga-sum-limits tioga-sum-size tioga-progress-factor t buffer-size 1 tread-check-id-buffer tread-get-length-buffer 4 8 error "basic tioga sizes are inconsistent" + "basic tioga part sizes are inconsistent" 80000 / 100 tioga-walk-loop] 19)) (defvar tioga-looks-count) (defvar tioga-looks-table) (defvar tioga-format-count) (defvar tioga-format-table) (defvar tioga-prop-count) (defvar tioga-prop-table) (defun tioga-init-tables nil (byte-code "ƉljƉȉƉɉ!!" [tioga-looks-count tioga-looks-table tioga-format-count tioga-format-table tioga-prop-count tioga-prop-table 1 (("" . 0)) (("" . 0)) (("" . 0)) tread-prop-index "prefix" "postfix"] 3)) (defun tioga-walk-loop nil (byte-code "    ?5 X+ X>̉ Z 1 XIX\\‰ Z 1Um 1UxU !U )1UU U\\!\\! U$U?U?# *1U W X!X.ZcX9XJZ\\!cU`   !)c!!Yv\" \"#@!\"$\"\\\\)) *1$U A! B!%C !# *)1&U D  B!%C !# *1'U&U #(1E\" . " [op terminal-node nil last-was-terminal format-index prop-index level run-len len done top-terminal-text-node-first top-terminal-text-node-last t top-start-node-first top-start-node-last top-end-node top-start-node top-terminal-text-node str top-rope top-comment length tioga-insert-text top-runs nRuns i look-index top-looks-first top-looks-last top-look1 top-look3 top-looks looks-str tioga-looks-count rl tioga-add-looks top-prop tioga-handle-prop top-prop-short top-end-of-file top-endNode tread-get-op -1 0 len-unspec tioga-init-tables work-loop-case--what-to-do-on-break tioga-do-end-node tread-get-str tread-format-index tread-get-int tread-span-text 1 tread-span-comment tioga-progress-report funcall tioga-error "Rope length(%d) doesn't match run length(%d) " foo tread-look-chars-to-index tread-get-looks-str tread-looks-index "no looks in run" "Look index(%d) too large. " tread-get-looks tread-prop-index tread-span-control tread-get-prop tread-get-byte "Illegal op code: %d "] 46)) (defun tioga-do-end-node nil (byte-code "YZ! \\\"" [level t tioga-end-node 0 1 tioga-error "Too many endNodes. " funcall] 5)) (defun work-loop-case--what-to-do-on-break nil (byte-code "U Uĉ2  \\!# " [level op top-end-of-file done t last-was-terminal terminal-node tioga-start-node format-index 0 tioga-do-end-node 1 funcall tread-get-format tread-get-op] 6)) (defun tioga-progress-report nil (byte-code " #Z \"\"ZQ!!)" [remains tioga-sum-limits tioga-text-next tioga-control-next tioga-comment-next tioga-progress-factor tioga-sum-size + message "Tioga: " 100 / * "%% converted." sit-for 0] 8)) (defun tread-get-length-buffer (pos) (byte-code "\\\"\"" [pos tread-get-length buffer-substring 4 0] 5)) (defun tread-get-length (str pos) (byte-code " \\ \\O! \\O!\" \\ \\O!\" \\ \\O!\"$" [str pos + string-to-char 1 2 lsh 8 3 24 4 16] 15)) (defun tread-check-id-buffer (pos id) (byte-code " G \\\" # \\)" [l id pos tread-check-id buffer-substring 0] 5)) (defun tread-check-id (str pos id) (byte-code " G\\O \"?!" [str pos id string= error "tread-check-id failed"] 5)) (defun tread-get-op nil (byte-code " Wf\\ ) " [tioga-control-next tioga-control-limit c t top-end-of-file 1] 2)) (defun tread-get-byte nil (byte-code " W \\ \"!)LJ" [tioga-control-next tioga-control-limit pos t 1 string-to-char buffer-substring 0] 4)) (defun tread-get-int nil (byte-code " ?M f \\ W \"V0U0V6! \"\"\\)) +" [nbits result done nil byte tioga-control-next byte-low 0 1 128 logand 127 21 3 tioga-error "(NYI) more than 23 bits of length" logior lsh 7] 8)) (defun tread-get-str nil (byte-code " Wf\\ !)!" [tioga-control-next tioga-control-limit len t 1 tread-span-control tioga-error "eof getting string length"] 3)) (defun tread-span-control (len) (byte-code " \\ V! \\ \")" [tioga-control-next len tioga-control-limit t pos tioga-error "eof getting rope from control" buffer-substring] 4)) (defun tread-span-comment (len) (byte-code " \\ V! \\ \")" [tioga-comment-next len tioga-comment-limit t pos tioga-error "eof getting rope from comment" buffer-substring] 4)) (defun tread-span-text (len) (byte-code " \\ V! \\ \")" [tioga-text-next len tioga-text-limit t pos tioga-error "eof getting rope from text" buffer-substring] 4)) (defun tread-get-looks-str nil (byte-code " \\ X \"!)" [pos tioga-control-next tioga-control-limit t 4 buffer-substring tioga-error "eof getting looks string"] 3)) (defun tread-look-chars-to-index (n) (byte-code "\" VM  Y \\X> ZZ \" \"Z  H \"\"I+B \") Z!)" [result n c bitnum-in-word bitnum-in-byte bytenum t make-string 4 0 tread-get-byte 97 31 % 8 3 / logior lsh 1 tioga-error "Illegal look character: %d" tread-looks-index] 12)) (defun tread-looks-index (looks-str) (byte-code "\" ǂ* \" ?' B B \\) A)" [looks-str t probe tioga-looks-table tioga-looks-count string= "" 0 assoc 1] 5)) (defun tread-get-looks (index) (byte-code " \"@ \")" [probe index tioga-looks-table t rassq tioga-error "invalid looks index (%d)"] 4)) (defun tread-format-index (format-str) (byte-code "\" ǂ* \" ?' B B \\) A)" [format-str t probe tioga-format-table tioga-format-count string= "" 0 assoc 1] 5)) (defun tread-get-format (index) (byte-code " \"@ \")" [probe index tioga-format-table t rassq tioga-error "invalid format index (%d)"] 4)) (defun tread-prop-index (prop-str) (byte-code "\" ǂ, \" ?)! B B \\+ A)" [prop-str t probe tioga-prop-table tioga-prop-count string= "" 0 assoc downcase 1] 6)) (defun tread-get-prop (index) (byte-code " \"@ \")" [probe index tioga-prop-table t rassq tioga-error "invalid property index (%d)"] 4)) (defun tioga-error (str &rest args) (byte-code "KP B\"" [str args apply error "Error converting Tioga: "] 5)) (defun tioga-format-looks (looks-str) (byte-code "Y>\"\"Z \" H\"V- !P*Z \\ +" [bitnum-in-word char result bitnum-in-byte bytenum looks-str 31 97 "" 0 % 8 3 / logand lsh 1 char-to-string] 8)) (provide (quote tioga))