From 7b1e850e86136da3a24923fe457f76c835620d6d Mon Sep 17 00:00:00 2001 From: Frank Duncan Date: Sun, 12 Jul 2015 09:05:08 -0500 Subject: [PATCH 1/1] No hanging close parens --- resources/hangingcloseparens1.lisp | 12 ++++++++++++ resources/hangingcloseparens2.lisp | 13 +++++++++++++ src/main/checker.lisp | 6 +++++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 resources/hangingcloseparens1.lisp create mode 100644 resources/hangingcloseparens2.lisp diff --git a/resources/hangingcloseparens1.lisp b/resources/hangingcloseparens1.lisp new file mode 100644 index 0000000..1f08a71 --- /dev/null +++ b/resources/hangingcloseparens1.lisp @@ -0,0 +1,12 @@ +(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 + (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/resources/hangingcloseparens2.lisp b/resources/hangingcloseparens2.lisp new file mode 100644 index 0000000..17cd142 --- /dev/null +++ b/resources/hangingcloseparens2.lisp @@ -0,0 +1,13 @@ +(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 + (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 ae6c1fb..3db05e2 100644 --- a/src/main/checker.lisp +++ b/src/main/checker.lisp @@ -14,7 +14,7 @@ ; * No empty lines at end of file ; * Never have two empty lines in a row ; * Only one in-package per file -; - No hanging close parens +; * No hanging close parens ; ; Some thoughts ; - form starting reader macros will have to be hand added to this code @@ -142,6 +142,10 @@ (< 0 *col-no*) "No whitespace only lines" (set-state :beginning-of-line-with-separator)))) + (defevaluator :beginning-of-symbols "\\)" + (constantly "No hanging close parens")) + (defevaluator :beginning-of-symbols-with-separator "\\)" + (constantly "No hanging close parens")) (defevaluator :beginning-of-symbols "" (lambda () (if -- 2.25.1