diff --git a/src/utils/read-sql-files.lisp b/src/utils/read-sql-files.lisp index f2bbbe4..0e26c7b 100644 --- a/src/utils/read-sql-files.lisp +++ b/src/utils/read-sql-files.lisp @@ -116,7 +116,14 @@ Another test case for the classic quotes: (#\' (case (parser-state state) (:eat (setf (parser-state state) :eqt)) (:esc (setf (parser-state state) :eqt)) - (:eqt (setf (parser-state state) :eat))) + (:eqt (setf (parser-state state) :eat)) + (:tag + (progn + ;; a tag name can't contain a single-quote + ;; get back to previous state + (let ((tag (pop-current-tag state))) + (format (parser-stream state) "$~a" tag)) + (reset-state state)))) (write-char char (parser-stream state))) @@ -134,6 +141,7 @@ Another test case for the classic quotes: ;; we act depending on the NEW state (case (parser-state state) (:eat (write-char char (parser-stream state))) + (:edq (write-char char (parser-stream state))) (:tag (push-new-tag state)) @@ -157,7 +165,7 @@ Another test case for the classic quotes: (:eat (setf (parser-state state) :eoq)) (otherwise (write-char char (parser-stream state))))) - (otherwise (cond ((member (parser-state state) '(:eat :eqt)) + (otherwise (cond ((member (parser-state state) '(:eat :eqt :edq)) (write-char char (parser-stream state))) ;; see @@ -175,9 +183,9 @@ Another test case for the classic quotes: (extend-current-tag state char) (progn - ;; not a tag actually: remove the - ;; parser-tags entry and push back its - ;; contents to the main output stream + ;; not a tag actually: remove the + ;; parser-tags entry and push back its + ;; contents to the main output stream (let ((tag (pop-current-tag state))) (format (parser-stream state) "$~a~c"