Allow source type names to be doube-quoted in CAST rules.

Fixes #1015.
This commit is contained in:
Dimitri Fontaine 2020-03-21 17:37:25 +01:00
parent 94d0612c12
commit 0daace9d70

View File

@ -23,7 +23,14 @@
(:lambda (extra)
(cons (third extra) t)))
(defrule cast-source-type (and kw-type trimmed-name)
;; type names may be "double quoted"
(defrule cast-type-name (or double-quoted-namestring
(and (alpha-char-p character)
(* (or (alpha-char-p character)
(digit-char-p character)))))
(:text t))
(defrule cast-source-type (and kw-type cast-type-name)
(:destructure (kw name) (declare (ignore kw)) (list :type name)))
(defrule table-column-name (and maybe-quoted-namestring
@ -65,12 +72,6 @@
,@(when ouct-s-p (list :on-update-current-timestamp
on-update-current-timestamp))))))
(defrule cast-type-name (or double-quoted-namestring
(and (alpha-char-p character)
(* (or (alpha-char-p character)
(digit-char-p character)))))
(:text t))
(defrule cast-to-type (and kw-to cast-type-name ignore-whitespace)
(:lambda (source)
(bind (((_ type-name _) source))