From 243043b049ee29fb5fbe17286f40f3392b57cbd0 Mon Sep 17 00:00:00 2001 From: Frank Duncan Date: Sun, 12 Jul 2015 12:53:57 -0500 Subject: [PATCH] Check for multiple spaces in form --- resources/twospaces.lisp | 14 ++++++++++++++ src/main/checker.lisp | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 resources/twospaces.lisp diff --git a/resources/twospaces.lisp b/resources/twospaces.lisp new file mode 100644 index 0000000..c5183b3 --- /dev/null +++ b/resources/twospaces.lisp @@ -0,0 +1,14 @@ +(in-package #:nothing) + +(defun small-guy (a b) (+ a b)) +(defun small-guy-2 (a b) (+ a b)) + +(defun hello-world (a b c) + (progn + (let + ((x y) + (z 9)) + (with-open-file (str "increasinglylongfilenamesfailme.dat" :direction :input :if-does-not-exist :create) + (when + (read-line str) + (format t "This file had some things in int, yay!~%"))))) diff --git a/src/main/checker.lisp b/src/main/checker.lisp index 2513812..bb057fb 100644 --- a/src/main/checker.lisp +++ b/src/main/checker.lisp @@ -8,7 +8,7 @@ ; * No line longer than 120 characters ; * No use of unexported symbols in other packages ; * No tabs -; - Only one space between elements in a form on a single line +; * Only one space between elements in a form on a single line ; * in-package must be first line in file unless file is package.lisp ; * No whitespace at end of line ; * No lines that are only whitespace @@ -49,7 +49,6 @@ :all ; matches everything ))) - (defun set-state (state) (when (not (find state *possible-states*)) (error "Can't set state to ~A" state)) @@ -184,4 +183,5 @@ ((and *form-stack* (/= (1+ (cadr (car *form-stack*))) *col-no*)) "All form elements must be indented equally") (t (set-state :normal))))) + (defevaluator :normal " " (constantly "Only one space between items of a form")) (defevaluator :normal "." (constantly nil))) -- 2.25.1