2887 |
|
|
2888 |
(defvar math-expr-data) |
(defvar math-expr-data) |
2889 |
|
|
2890 |
(defun math-read-expr (exp-str) |
(defun math-read-expr (math-exp-str) |
2891 |
(let ((exp-pos 0) |
(let ((math-exp-pos 0) |
2892 |
(exp-old-pos 0) |
(math-exp-old-pos 0) |
2893 |
(exp-keep-spaces nil) |
(math-exp-keep-spaces nil) |
2894 |
exp-token math-expr-data) |
math-exp-token math-expr-data) |
2895 |
(while (setq exp-token (string-match "\\.\\.\\([^.]\\|.[^.]\\)" exp-str)) |
(while (setq math-exp-token (string-match "\\.\\.\\([^.]\\|.[^.]\\)" math-exp-str)) |
2896 |
(setq exp-str (concat (substring exp-str 0 exp-token) "\\dots" |
(setq math-exp-str (concat (substring math-exp-str 0 math-exp-token) "\\dots" |
2897 |
(substring exp-str (+ exp-token 2))))) |
(substring math-exp-str (+ math-exp-token 2))))) |
2898 |
(math-build-parse-table) |
(math-build-parse-table) |
2899 |
(math-read-token) |
(math-read-token) |
2900 |
(let ((val (catch 'syntax (math-read-expr-level 0)))) |
(let ((val (catch 'syntax (math-read-expr-level 0)))) |
2901 |
(if (stringp val) |
(if (stringp val) |
2902 |
(list 'error exp-old-pos val) |
(list 'error math-exp-old-pos val) |
2903 |
(if (equal exp-token 'end) |
(if (equal math-exp-token 'end) |
2904 |
val |
val |
2905 |
(list 'error exp-old-pos "Syntax error")))))) |
(list 'error math-exp-old-pos "Syntax error")))))) |
2906 |
|
|
2907 |
(defun math-read-plain-expr (exp-str &optional error-check) |
(defun math-read-plain-expr (exp-str &optional error-check) |
2908 |
(let* ((calc-language nil) |
(let* ((calc-language nil) |