Add examples and clean up some stuff
This commit is contained in:
+4
-2
@@ -1,5 +1,7 @@
|
||||
;;;; Parse back the states printed by pprint.lisp
|
||||
(defpackage :cl-quantum/parse
|
||||
(:use :cl :cl-quantum/state)
|
||||
(:documentation "Parse back the states printed by pprint.lisp.")
|
||||
(:use :cl :cl-quantum/math :cl-quantum/state)
|
||||
(:export #:parse-real
|
||||
#:parse-complex
|
||||
#:parse-state
|
||||
@@ -44,7 +46,7 @@ stopped. That is, the index of the first un-parsed character."
|
||||
(list 0 0)
|
||||
(error "Malformed number: ~s" (subseq string start end))))))
|
||||
|
||||
(define-constatnt +parse-complex-regexp+
|
||||
(define-constant +parse-complex-regexp+
|
||||
(ppcre:create-scanner
|
||||
"^\\s*([-+])?\\s*([-+]?)([0-9/.]+(?:[eE][-+]?[0-9]+)?)?(i)?"
|
||||
:extended-mode t)
|
||||
|
||||
Reference in New Issue
Block a user