Compare commits

...

3 commits

3 changed files with 8 additions and 6 deletions

View file

@ -8,7 +8,9 @@
:finally (return start))))
(subseq string
start
(position #\Newline string :start (1+ start)))))
(if (< start (length string))
(position #\Newline string :start (1+ start))
nil))))
(defun point-out-source (source)
(if (null source)

View file

@ -11,4 +11,4 @@
(:export #:usc-init #:compile-string-to-bytes
;; Errors
#:usc-error #:tokenizer-error #:missing-function-error
#:parser-error))
#:parser-error #:source))

View file

@ -164,13 +164,13 @@ reading immediately. Should be a subset of *SPECIAL-TOKEN-CHARS*.")
(next-token))
;; Process and add a newline
((char= char #\Newline)
(setf in-comment-p nil
line (1+ line)
column 0)
(unless (zerop (length token-text-buffer))
(next-token))
(vector-push #\Newline token-text-buffer)
(next-token))
(next-token)
(setf in-comment-p nil
line (1+ line)
column 0))
;; Starting a comment
((and (member char *line-comment-chars* :test #'char=) (not in-comment-p))
(unless (zerop (length token-text-buffer))