From: morioka Date: Wed, 28 Aug 1996 17:33:26 +0000 (+0000) Subject: (std11-analyze-enclosure): New function. X-Git-Tag: XEmacs-20_3-b6~51 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dec0641cd380a0135b4521dacb83f0702c0476ed;p=elisp%2Fapel.git (std11-analyze-enclosure): New function. (std11-analyze-quoted-string): New implementation. --- diff --git a/std11-parse.el b/std11-parse.el index 2514776..45fe23b 100644 --- a/std11-parse.el +++ b/std11-parse.el @@ -4,7 +4,7 @@ ;; Author: MORIOKA Tomohiko ;; Keywords: mail, news, RFC 822, STD 11 -;; Version: $Id: std11-parse.el,v 0.4 1996-08-28 17:25:56 morioka Exp $ +;; Version: $Id: std11-parse.el,v 0.5 1996-08-28 17:33:26 morioka Exp $ ;; This file is part of tl (Tiny Library). @@ -59,10 +59,10 @@ (substring str end) )))) -(defun std11-analyze-quoted-string (str) +(defun std11-analyze-enclosure (str type open close) (let ((len (length str))) (if (and (> len 0) - (eq (aref str 0) ?\")) + (eq (aref str 0) open)) (let ((i 1) chr dest) (catch 'tag (while (< i len) @@ -74,10 +74,9 @@ ) (setq dest (concat dest (char-to-string (aref str i)))) ) - ((eq chr ?\") + ((eq chr close) (throw 'tag - (cons (cons 'quoted-string dest) - (substring str (1+ i))) + (cons (cons type dest) (substring str (1+ i))) ) ) (t @@ -86,6 +85,10 @@ (setq i (1+ i)) )))))) +(defun std11-analyze-quoted-string (str) + (std11-analyze-enclosure str 'quoted-string ?\" ?\") + ) + ;;; @ end ;;;