From b8dd346d482b730a052902be1af724b16c6f2979 Mon Sep 17 00:00:00 2001 From: Vladimir Sedach Date: Wed, 5 Dec 2018 19:30:30 -0800 Subject: [PATCH] Change ENCODE-JS-IDENTIFIER warnings to SIMPLE-STYLE-WARNING --- src/deprecated-interface.lisp | 3 --- src/utils.lisp | 15 +++++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/deprecated-interface.lisp b/src/deprecated-interface.lisp index 1f1de34..bd06aae 100644 --- a/src/deprecated-interface.lisp +++ b/src/deprecated-interface.lisp @@ -41,9 +41,6 @@ (in-package #:parenscript) (in-readtable :parenscript) -(define-condition simple-style-warning (simple-warning style-warning) - ()) - (defun warn-deprecated (old-name &optional new-name) (warn 'simple-style-warning :format-control "~:@(~a~) is deprecated~:[.~;, use ~:@(~a~) instead~]" diff --git a/src/utils.lisp b/src/utils.lisp index 7c3b88d..e7ede3f 100644 --- a/src/utils.lisp +++ b/src/utils.lisp @@ -39,6 +39,9 @@ (in-package #:parenscript) +(define-condition simple-style-warning (simple-warning style-warning) + ()) + (let ((cache (make-hash-table :test 'equal))) (defun encode-js-identifier (identifier) "Given a string, produces to a valid JavaScript identifier by @@ -46,15 +49,19 @@ following transformation heuristics case conversion. For example, paren-script becomes parenScript, *some-global* becomes SOMEGLOBAL." (when (and (not (string= identifier "[]")) (find #\[ identifier)) - (warn "Parenscript symbol ~A contains a literal array accessor. + (warn 'simple-style-warning + :format-control + "Parenscript symbol ~A contains a literal array accessor. This compound naming convention is deprecated and will be removed! Use AREF, ELT, GETPROP, @, or CHAIN instead." - identifier)) + :format-arguments (list identifier))) (when (find #\. identifier) - (warn "Parenscript symbol ~A contains one or more dot operators. + (warn 'simple-style-warning + :format-control + "Parenscript symbol ~A contains one or more dot operators. This compound naming convention is deprecated and will be removed! Use GETPROP, @, or CHAIN instead." - identifier)) + :format-arguments (list identifier))) (or (gethash identifier cache) (setf -- 2.11.4.GIT