From: Volker v. N. <va...@us...> - 2007-05-30 20:42:34
|
Update of /cvsroot/maxima/maxima/share/contrib/stringproc In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv14645/share/contrib/stringproc Modified Files: stringproc.lisp Log Message: improving $parsetoken Index: stringproc.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/share/contrib/stringproc/stringproc.lisp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- stringproc.lisp 29 May 2007 12:28:50 -0000 1.20 +++ stringproc.lisp 30 May 2007 20:42:29 -0000 1.21 @@ -296,18 +296,19 @@ (error nil nil)))) ; ignore errors bf) (cond ((or (integerp res) - (floatp res)) + (typep res 'long-float)) ;; Maxima does not accept complex numbers, etc. - ;; parsetoken will still accept Lisp syntax, e.g. #C(2 `,0), 2.1s1 + ;; parsetoken will still accept Lisp syntax, e.g. #C(2 `,0) ;; but we're not fixing that for now res) ((rationalp res) (list '(rat simp) (numerator res) (denominator res))) ((and (symbolp res) - (setf bf (maxima-nregex::regex "[0-9]*\\.*[0-9]*[bB]+[+-]*[0-9]+" (string res))) ) - (with-input-from-string - (s (concatenate 'string (car bf) "$")) - (third (mread s)) )) + (setf bf (car (or (maxima-nregex::regex "^[+-]?[0-9]+\\.?[0-9]*[bB][+-]?[0-9]+$" (string res)) + (maxima-nregex::regex "^[+-]?\\.[0-9]+[bB][+-]?[0-9]+$" (string res)) )))) + (with-input-from-string + (s (concatenate 'string bf "$")) + (third (mread s)) )) (t nil) ))) ;; $sconcat for lists, allows an optional user defined separator string |