(defun small-guy (a b) (+ a b))
(defun small-guy-2 (a b) (+ a b))
+; This comment is awesome
(defun hello-world (a b c)
(progn
(let
- ((x y)
- (z 9))
+ ((x y) ; Ok, this comment is also great
+ (z 9)) ; so is this one!
(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!~%")))))
+ (format t "This file had some things in int, yay!~%"))))))
+
+(defvar *x* "hello world
+ this is a multiline string
+ with \" some escaped things
+ and some (_) and whatnot
+ ")
;
; Exceptions
; * comments
-; - multiline strings
+; * multiline strings
; Some thoughts
; - form starting reader macros will have to be hand added to this code
: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 ""