From db0b770d2b149bdbab53c66190dd9c57d06ce414 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Thu, 10 Mar 2011 16:54:53 +0100 Subject: Be more lenient regarding non-string and non-list variables. --- json-template.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'json-template.lisp') diff --git a/json-template.lisp b/json-template.lisp index 9e36a42..d4b768d 100644 --- a/json-template.lisp +++ b/json-template.lisp @@ -47,8 +47,8 @@ (list #\. #\#)))) until (null terminator))) -(defun parse-template-string (stream) - (parse-raw-tokens (tokenize-template-string stream))) +(defun parse-template-string (string) + (parse-raw-tokens (tokenize-template-string string))) (defun parse-directive (string) (let* ((space1 (position #\Space string)) @@ -128,6 +128,8 @@ (defun getcontext (context key &aux (result context)) (dolist (key-component key result) + (when (atom result) + (return-from getcontext nil)) (setq result (getf result key-component -- cgit v1.2.3