From 0daace9d70ad0f81face22f5b08f517385e6ee7a Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Sat, 21 Mar 2020 17:37:25 +0100 Subject: [PATCH] Allow source type names to be doube-quoted in CAST rules. Fixes #1015. --- src/parsers/command-cast-rules.lisp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/parsers/command-cast-rules.lisp b/src/parsers/command-cast-rules.lisp index 509c142..e6345ec 100644 --- a/src/parsers/command-cast-rules.lisp +++ b/src/parsers/command-cast-rules.lisp @@ -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))