From 835f223442bae604f3b825ec8fcf98560efee8a9 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Wed, 2 Mar 2011 18:10:18 +0100 Subject: Rename *TEMPLATE-FILTERS* to *TEMPLATE-FORMATTERS* in accordance with JSON Template terminology. --- json-template.lisp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/json-template.lisp b/json-template.lisp index 0e39004..4ea4b9a 100644 --- a/json-template.lisp +++ b/json-template.lisp @@ -19,14 +19,14 @@ (:use #:common-lisp) (:export #:parse-template-string #:expand-template - #:*template-filters*)) + #:*template-formatters*)) (in-package #:json-template) -(defvar *template-filters* - `(;;("html" . filter-html) - ;;("html-attr-value" . filter-html-attr-value) +(defvar *template-formatters* + `(;;("html" . format-html) + ;;("html-attr-value" . format-html-attr-value) ("raw" . identity))) (defun tokenize-template-string (string) @@ -151,11 +151,11 @@ (:text (write-string (second thing) stream)) (:variable - (destructuring-bind (variable filter) (cdr thing) + (destructuring-bind (variable formatter) (cdr thing) (let ((value (lookup-context contexts variable))) (format stream "~A" - (if filter - (funcall (cdr (assoc filter *template-filters* + (if formatter + (funcall (cdr (assoc formatter *template-formatters* :test #'equal)) value) value))))) -- cgit v1.2.3