From: Frank Duncan Date: Sun, 12 Jul 2015 14:05:08 +0000 (-0500) Subject: No hanging close parens X-Git-Tag: 0.1~8 X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?a=commitdiff_plain;h=7b1e850e86136da3a24923fe457f76c835620d6d;p=wolf No hanging close parens --- 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