From: Frank Duncan Date: Sat, 11 Jul 2015 19:25:08 +0000 (-0500) Subject: Only one in-package per file X-Git-Tag: 0.1~14 X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?a=commitdiff_plain;h=c03906d;p=wolf Only one in-package per file --- diff --git a/resources/twoinpackage.lisp b/resources/twoinpackage.lisp new file mode 100644 index 0000000..fb7fbfc --- /dev/null +++ b/resources/twoinpackage.lisp @@ -0,0 +1,17 @@ +(in-package #:nothing) + +(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!~%"))))) + +(in-package #:something) + +(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 b369a1b..a9c4082 100644 --- a/src/main/checker.lisp +++ b/src/main/checker.lisp @@ -11,6 +11,7 @@ ; * in-package must be first line in file unless file is package.lisp ; - No whitespace only lines ; - No empty lines at end of file +; * Only one in-package per file ; ; Some thoughts ; - form starting reader macros will have to be hand added to this code @@ -104,8 +105,9 @@ (lambda () (set-state :normal) nil)) (defevaluator :begin ".*" - (lambda () - "Must begin with in-package form")) + (constantly "Must begin with in-package form")) + (defevaluator :normal "\\( *in-package " + (constantly "Only one in-package per file")) (defevaluator :normal "\\n" (lambda () (incf *line-no*) @@ -121,9 +123,9 @@ (lambda () (let ((form (pop *form-stack*))) - (when - (< 50 (- *line-no* (car form))) - "Forms can't be over 50 lines long")))) + (cond + ((not form) "Unmatched ending paren") + ((< 50 (- *line-no* (car form))) "Forms can't be over 50 lines long"))))) (defevaluator :normal "." (constantly nil)) )