Add exception for strings
[wolf] / src / main / checker.lisp
index 0e3dd7a39b4095508cadb59b801ed2c72e038f34..3a78d88980958db5d1085f47b31d2369ce687c99 100644 (file)
@@ -19,7 +19,7 @@
 ;
 ; Exceptions
 ; * comments
-; - multiline strings
+; * multiline strings
 
 ; Some thoughts
 ; - form starting reader macros will have to be hand added to this code
@@ -49,6 +49,7 @@
     :beginning-of-line-with-comment-and-separator ; weird edge case part 2
     :first-symbol ; first symbol of form/line
     :all ; matches everything
+    :in-string
    )))
 
 (defun set-state (state)
      ((< 50 (- *line-no* (car form))) "Forms can't be over 50 lines long")
      (t (setf *form-ended-on-same-line* (= *line-no* (car form))) nil)))))
  (defevaluator :normal "::" (constantly "No internal symbols from other packages"))
+ (defevaluator :in-string "\\\\\"" (constantly nil))
+ (defevaluator :normal "\"" (lambda () (set-state :in-string)))
+ (defevaluator :in-string "\"" (lambda () (set-state :normal)))
+ (defevaluator :in-string "\\n"
+  (lambda ()
+   (incf *line-no*)
+   (setf *col-no* -1)
+   nil))
+ (defevaluator :in-string "." (constantly nil))
  (defevaluator :first-symbol "\\n" (constantly "No new line after opening form"))
  (defevaluator :first-symbol " " (constantly "No space after opening parens"))
  (defevaluator :first-symbol ""