diff options
author | Jay Belanger <jay.p.belanger@gmail.com> | 2004-11-11 05:53:19 +0000 |
---|---|---|
committer | Jay Belanger <jay.p.belanger@gmail.com> | 2004-11-11 05:53:19 +0000 |
commit | 411b1407624dc3f8de89532f58f6bdb8138435f3 (patch) | |
tree | 190f2d3d6480a75a690059d447dd8b4a019f473a /lisp/calc/calc-vec.el | |
parent | 679e2630d32217a70c8970788da415558613b38f (diff) | |
download | emacs-411b1407624dc3f8de89532f58f6bdb8138435f3.tar.gz |
(math-read-brackets, math-check-for-commas): Use declared variable
math-exp-pos.
(math-check-for-commas): Use declared variable math-exp-str.
(math-read-brackets): Use declared variables math-exp-old-pos,
math-exp-keep-spaces.
(math-read-brackets, math-read-vector, math-read-matrix): Use
declared variable math-exp-token.
Diffstat (limited to 'lisp/calc/calc-vec.el')
-rw-r--r-- | lisp/calc/calc-vec.el | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/lisp/calc/calc-vec.el b/lisp/calc/calc-vec.el index c09d2715889..a78f98ec3cc 100644 --- a/lisp/calc/calc-vec.el +++ b/lisp/calc/calc-vec.el @@ -1466,41 +1466,41 @@ (defun math-read-brackets (space-sep close) (and space-sep (setq space-sep (not (math-check-for-commas)))) (math-read-token) - (while (eq exp-token 'space) + (while (eq math-exp-token 'space) (math-read-token)) (if (or (equal math-expr-data close) - (eq exp-token 'end)) + (eq math-exp-token 'end)) (progn (math-read-token) '(vec)) - (let ((save-exp-pos exp-pos) - (save-exp-old-pos exp-old-pos) - (save-exp-token exp-token) + (let ((save-exp-pos math-exp-pos) + (save-exp-old-pos math-exp-old-pos) + (save-exp-token math-exp-token) (save-exp-data math-expr-data) - (vals (let ((exp-keep-spaces space-sep)) + (vals (let ((math-exp-keep-spaces space-sep)) (if (or (equal math-expr-data "\\dots") (equal math-expr-data "\\ldots")) '(vec (neg (var inf var-inf))) (catch 'syntax (math-read-vector)))))) (if (stringp vals) (if space-sep - (let ((error-exp-pos exp-pos) - (error-exp-old-pos exp-old-pos) + (let ((error-exp-pos math-exp-pos) + (error-exp-old-pos math-exp-old-pos) vals2) - (setq exp-pos save-exp-pos - exp-old-pos save-exp-old-pos - exp-token save-exp-token + (setq math-exp-pos save-exp-pos + math-exp-old-pos save-exp-old-pos + math-exp-token save-exp-token math-expr-data save-exp-data) - (let ((exp-keep-spaces nil)) + (let ((math-exp-keep-spaces nil)) (setq vals2 (catch 'syntax (math-read-vector)))) (if (and (not (stringp vals2)) (or (assoc math-expr-data '(("\\ldots") ("\\dots") (";"))) (equal math-expr-data close) - (eq exp-token 'end))) + (eq math-exp-token 'end))) (setq space-sep nil vals vals2) - (setq exp-pos error-exp-pos - exp-old-pos error-exp-old-pos) + (setq math-exp-pos error-exp-pos + math-exp-old-pos error-exp-old-pos) (throw 'syntax vals))) (throw 'syntax vals))) (if (or (equal math-expr-data "\\dots") @@ -1511,7 +1511,7 @@ (cons 'calcFunc-mul (cdr vals)) (nth 1 vals))) (let ((exp2 (if (or (equal math-expr-data close) (equal math-expr-data ")") - (eq exp-token 'end)) + (eq math-exp-token 'end)) '(var inf var-inf) (math-read-expr-level 0)))) (setq vals @@ -1521,48 +1521,48 @@ exp2))) (if (not (or (equal math-expr-data close) (equal math-expr-data ")") - (eq exp-token 'end))) + (eq math-exp-token 'end))) (throw 'syntax "Expected `]'"))) (if (equal math-expr-data ";") - (let ((exp-keep-spaces space-sep)) + (let ((math-exp-keep-spaces space-sep)) (setq vals (cons 'vec (math-read-matrix (list vals)))))) (if (not (or (equal math-expr-data close) - (eq exp-token 'end))) + (eq math-exp-token 'end))) (throw 'syntax "Expected `]'"))) - (or (eq exp-token 'end) + (or (eq math-exp-token 'end) (math-read-token)) vals))) (defun math-check-for-commas (&optional balancing) (let ((count 0) - (pos (1- exp-pos))) + (pos (1- math-exp-pos))) (while (and (>= count 0) (setq pos (string-match (if balancing "[],[{}()<>]" "[],[{}()]") - exp-str (1+ pos))) - (or (/= (aref exp-str pos) ?,) (> count 0) balancing)) - (cond ((memq (aref exp-str pos) '(?\[ ?\{ ?\( ?\<)) + math-exp-str (1+ pos))) + (or (/= (aref math-exp-str pos) ?,) (> count 0) balancing)) + (cond ((memq (aref math-exp-str pos) '(?\[ ?\{ ?\( ?\<)) (setq count (1+ count))) - ((memq (aref exp-str pos) '(?\] ?\} ?\) ?\>)) + ((memq (aref math-exp-str pos) '(?\] ?\} ?\) ?\>)) (setq count (1- count))))) (if balancing pos - (and pos (= (aref exp-str pos) ?,))))) + (and pos (= (aref math-exp-str pos) ?,))))) (defun math-read-vector () (let* ((val (list (math-read-expr-level 0))) (last val)) (while (progn - (while (eq exp-token 'space) + (while (eq math-exp-token 'space) (math-read-token)) - (and (not (eq exp-token 'end)) + (and (not (eq math-exp-token 'end)) (not (equal math-expr-data ";")) (not (equal math-expr-data close)) (not (equal math-expr-data "\\dots")) (not (equal math-expr-data "\\ldots")))) (if (equal math-expr-data ",") (math-read-token)) - (while (eq exp-token 'space) + (while (eq math-exp-token 'space) (math-read-token)) (let ((rest (list (math-read-expr-level 0)))) (setcdr last rest) @@ -1572,7 +1572,7 @@ (defun math-read-matrix (mat) (while (equal math-expr-data ";") (math-read-token) - (while (eq exp-token 'space) + (while (eq math-exp-token 'space) (math-read-token)) (setq mat (nconc mat (list (math-read-vector))))) mat) |