X-Git-Url: https://code.consxy.com/gitweb/gitweb.cgi?a=blobdiff_plain;f=src%2Fmain%2Fvar.lisp;h=4238762bf9bef4d55c42bbaa66a8408c7770bd5d;hb=6c443e37a666be2246cf410847e6851601c16dbc;hp=c184795552b52dff6f518d7502915fb4e6ab0178;hpb=35b42c73638093521b3b08c8ea31e6d8ca71146e;p=sheep diff --git a/src/main/var.lisp b/src/main/var.lisp index c184795..4238762 100644 --- a/src/main/var.lisp +++ b/src/main/var.lisp @@ -23,7 +23,6 @@ (defun verify-next-line (&key optional) (cond ((and optional (not (more))) t) - ((not (more)) (fire-error (format nil "Expected line after: ~A" (prev-line)))) ((cl-ppcre:scan " $" (peek)) (fire-error (format nil "Can't end line with a space: ~A" (peek)))) ((< 120 (length (peek))) (fire-error (format nil "Longer than 120 chars: ~A" (peek)))))) @@ -40,7 +39,7 @@ (cons (format nil "~A~A~A" (subseq next-line 2 (length next-line)) - (if (and (car rest-of-freeform) (string/= "" (car rest-of-freeform))) " " "") + (if (string/= "" (car rest-of-freeform)) " " "") (car rest-of-freeform)) (cdr rest-of-freeform)))) ((string= "" next-line) @@ -70,6 +69,7 @@ (process-examples)))) (defun parse-examples () + ; This shouldn't fire, unless there's a bug in our processing (when (string/= "EXAMPLES:" (next)) (fire-error (format nil "Expected EXAMPLES: instead of: ~A" (prev-line)))) (expect-blank-line) (list :examples (process-examples))) @@ -86,7 +86,6 @@ (lambda (text-item) (cond - ((not (stringp text-item)) (list text-item)) ((not (cl-ppcre:scan (cl-ppcre:quote-meta-chars (car remaining-keywords)) text-item)) (list text-item)) (t (let @@ -96,8 +95,6 @@ (mapcar (lambda (ti) (list (list :keyword (car remaining-keywords)) ti)) (cdr split-text))))))) (inject-keywords text (cdr remaining-keywords))))))) (list :text (inject-keywords text *keywords*)))) -; (map -; (list :text text)) (defun parse-header (var) (verify-next-line) @@ -105,8 +102,6 @@ ((var-name (symbol-name var))) (when (not (string= var-name (peek))) (fire-error (format nil "First line of ~A did not match: ~A, ~A" var var-name (peek)))) - (when (cl-ppcre:scan "[a-z]" var-name) - (fire-error (format nil "Variable name should be all uppercase: ~A" var-name))) (add-keyword var-name) (next) (expect-blank-line) @@ -134,6 +129,7 @@ (cond ((stringp text) text) ((and (listp text) (eql :keyword (car text))) (format nil "_~(~A~)_" (cadr text))) + ; This should never fire, unless there's a bug in our processor (t (fire-error (format nil "Don't know how to convert text: ~S" text))))) (cadr text))))