;ELC ;;; Compiled by mwolson@grepfind.mwolson.org on Thu Jan 24 00:15:33 2008 ;;; from file /stuff/proj/emacs/dvc/mwolson/lisp/xmtn-basic-io.el ;;; in Emacs version 23.0.50.2 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. (if (and (boundp 'emacs-version) (< (aref emacs-version (1- (length emacs-version))) ?A) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19.29"))) (error "`xmtn-basic-io.el' was compiled for Emacs 19.29 or later")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\302\303!\210\302\304!\210\305B\306\305!\2049\307\305\310 \311\312\313 #\210\311\314\315 #\210\311\316\317 #\210\311\320\321 #\210\311\322\323 #\210 )\"\210\302\207" [current-load-list table require cl xmtn-base xmtn-basic-io--*syntax-table* default-boundp set-default make-syntax-table modify-syntax-entry 95 "_" 91 "(" 93 ")" 34 "\"" 92 "/"] 6) (defalias 'xmtn-basic-io--unescape-field #[(string) "\302\303\304 #\203\305\306\307\211 $\302\225T\202) \207" [start string 0 string-match "\\\\" replace-match "" t] 5]) (put 'xmtn-basic-io--unescape-field 'byte-optimizer 'byte-compile-inline-expand) (defalias 'xmtn-basic-io--read-key #[nil "`\301\302!\210\303`\")\207" [start skip-syntax-forward "w_" buffer-substring-no-properties] 4]) (put 'xmtn-basic-io--read-key 'byte-optimizer 'byte-compile-inline-expand) (defalias 'xmtn-basic-io--read-field #[nil "\303`\304\"`f\305=\2033\301\306`TS\"\307\310\311 \n#\203,\312\313\314\211 $\307\225T\202) )D\202H`TS=\203@\315C\202H\316\306`TS\"Db\210)\207" [end string start scan-sexps 1 34 buffer-substring-no-properties 0 string-match "\\\\" replace-match "" t null-id id] 6]) (put 'xmtn-basic-io--read-field 'byte-optimizer 'byte-compile-inline-expand) (defalias 'xmtn-basic-io--skip-white-space #[nil "\300\301w\207" [" " nil] 2]) (put 'xmtn-basic-io--skip-white-space 'byte-optimizer 'byte-compile-inline-expand) #@58 Skip blank lines (if any), so parser starts on a stanza. (defalias 'xmtn-basic-io-skip-blank-lines #[nil "\300 \210\301\302f\303\"\203\304u\210\202\301\302f\305\"\203 \306\302w\210\202\300 \207" [beginning-of-line memql nil (10) 1 (32) " "] 3 (#$ . 2004)]) (defalias 'xmtn-basic-io--parse-nonempty-line #[nil "\304\305w\210`\306\307!\210\310`\")\305\305f\311=\204n\304\305w\210\312`\313\"`f\314=\203O\303\310`T\nS\"\315\316\317 #\203H\320\321\322\211 $\315\225T\2022) )D\202d`T\nS=\203\\\323C\202d\324\310`T\nS\"D\nb\210) B\202 \237)B\313u\210\207" [start #1=#:--cl-var-- end string " " nil skip-syntax-forward "w_" buffer-substring-no-properties 10 scan-sexps 1 34 0 string-match "\\\\" replace-match "" t null-id id] 7]) (put 'xmtn-basic-io--parse-nonempty-line 'byte-optimizer 'byte-compile-inline-expand) (defalias 'xmtn-basic-io--next-parsed-line #[nil "\304\305f\306\"\203 \307u\210\310\207\304\305f\311\"\203\312\207\313\305w\210`\314\315!\210\316`\")\305\305f\317=\204\205\313\305w\210\320`\307\"`f\321=\203f\303\316`T\nS\"\322\323\324 #\203_\325\326\327\211 $\322\225T\202I) )D\202{`T\nS=\203s\330C\202{\331\316`T\nS\"D\nb\210) B\202( \237)B\307u\210\207" [start #1=#:--cl-var-- end string memql nil (10) 1 empty (nil) eof " " skip-syntax-forward "w_" buffer-substring-no-properties 10 scan-sexps 34 0 string-match "\\\\" replace-match "" t null-id id] 7]) (put 'xmtn-basic-io--next-parsed-line 'byte-optimizer 'byte-compile-inline-expand) (defalias 'xmtn-basic-io--next-stanza #[nil "\306\211\307\306f\310\"\203\311u\210\312\202\224\307\306f\313\"\203\314\202\224\315\306w\210`\316\317!\210\320\n`\")\306\306f\321=\204\215\315\306w\210\322`\311\"`f\323=\203n\305\320`T\fS\"\324\325\326 \n#\203g\327\330\331\211 $\324\225T\202Q) )D\202\203`T\fS=\203{\332C\202\203\333\320`T\fS\"D\fb\210) B\2020 \237)B\311u\210\211\334>\204\242 B\202 \237*\207" [line accu start #1=#:--cl-var-- end string nil memql (10) 1 empty (nil) eof " " skip-syntax-forward "w_" buffer-substring-no-properties 10 scan-sexps 34 0 string-match "\\\\" replace-match "" t null-id id (empty eof)] 9]) (defalias 'xmtn-basic-io--next-parsed-line-notinline #[nil "\304\305f\306\"\203 \307u\210\310\207\304\305f\311\"\203\312\207\313\305w\210`\314\315!\210\316`\")\305\305f\317=\204\205\313\305w\210\320`\307\"`f\321=\203f\303\316`T\nS\"\322\323\324 #\203_\325\326\327\211 $\322\225T\202I) )D\202{`T\nS=\203s\330C\202{\331\316`T\nS\"D\nb\210) B\202( \237)B\307u\210\207" [start #1=#:--cl-var-- end string memql nil (10) 1 empty (nil) eof " " skip-syntax-forward "w_" buffer-substring-no-properties 10 scan-sexps 34 0 string-match "\\\\" replace-match "" t null-id id] 7]) (defalias 'xmtn-basic-io--generate-body-for-with-parser-form #[(parser-fn parser-var buffer-form body) "\305 \306 DC\307\310BB\306\n\311\312\307 CEEDC\fBBF)\207" [buffer buffer-form parser-var parser-fn body gensym let with-current-buffer ((set-syntax-table xmtn-basic-io--*syntax-table*) (goto-char (point-min))) lambda nil] 10]) #@1357 Run BODY with LINE-PARSER bound to a parser that parses BUFFER-FORM. BUFFER-FORM should evaluate to a buffer that contains, between (point-min) and (point-max), zero or more lines in monotone's basic_io format. BODY will be evaluated with LINE-PARSER (a symbol) bound to a closure that will, each time it is called, return the next line in parsed form, or the symbol `eof' if there are no more lines. Empty lines are returned as the symbol `empty'. Each non-empty line is a list of a key and zero or more fields. The key is a string. Each field is either a one-element list (null-id) and represents an empty ID field (what monotone prints as [] in basic_io format), a two-element list (id HASH-ID), where HASH-ID is a string of forty hexadecimal digits (what monotone prints as [HASH-ID]), or a two-element list (string STRING), where STRING is a string (what monotone prints as "STRING"). Lines and their contents are always fresh objects. The macro `xmtn-match' is a useful way to process basic_io lines parsed this way. The parser should be assumed to have dynamic extent. If the contents of the buffer that BUFFER-FORM evaluates to, or the position of point in that buffer, are modified from within BODY (other than by calling the parser), the parser becomes invalid and must not be called any more. (fn (LINE-PARSER buffer-form) &body BODY) (defalias 'xmtn-basic-io-with-line-parser '(macro . #[(&rest body) "\203\f\211A@\202\304\305\306GD\"\211G\307U\203# \211A@\202*\304\305\306 GD\" @\310\311\n $+\207" [body #1=#:--cl-rest-- line-parser buffer-form signal wrong-number-of-arguments xmtn-basic-io-with-line-parser 2 xmtn-basic-io--generate-body-for-with-parser-form xmtn-basic-io--next-parsed-line-notinline] 6 (#$ . 5089)])) #@1013 Run BODY with STANZA-PARSER bound to a parser that parses BUFFER-FORM. BUFFER-FORM should evaluate to a buffer that contains, between (point-min) and (point-max), zero or more lines in monotone's basic_io format. BODY will be evaluated with STANZA-PARSER (a symbol) bound to a closure that will, each time it is called, return the next stanza in parsed form, or the symbol `nil' if there are no more stanzas. Each stanza will be returned as a fresh, non-empty list of so-called lines. See `xmtn-basic-io-with-line-parser' for a definition of the term "line" in this context. The macro `xmtn-match' and the function `assoc' are useful to process basic_io stanzas parsed this way. The parser should be assumed to have dynamic extent. If the contents of the buffer that BUFFER-FORM evaluates to, or the position of point in that buffer, are modified from within BODY (other than by calling the parser), the parser becomes invalid and must not be called any more. (fn (STANZA-PARSER buffer-form) &body BODY) (defalias 'xmtn-basic-io-with-stanza-parser '(macro . #[(&rest body) "\203\f\211A@\202\304\305\306GD\"\211G\307U\203# \211A@\202*\304\305\306 GD\" @\310\311\n $+\207" [body #1=#:--cl-rest-- stanza-parser buffer-form signal wrong-number-of-arguments xmtn-basic-io-with-stanza-parser 2 xmtn-basic-io--generate-body-for-with-parser-form xmtn-basic-io--next-stanza] 6 (#$ . 6855)])) (provide 'xmtn-basic-io)