Commit 2eefb76c authored by Christophe Rhodes's avatar Christophe Rhodes
Browse files

Be careful to claim any succeeding whitespace as having been parsed in

update-syntax, but not the whole of the buffer if that hasn't actually
been done.

Marginal improvements to Export Paiprolog debugging command.
parent 4d56337b
......@@ -1221,9 +1221,10 @@
(advance-parse parser (list next-lexeme)
(slot-value current-token 'state)))
(incf valid-parse))))
(values 0 (if (= valid-parse (nb-lexemes lexer))
(size (buffer syntax))
(start-offset (lexeme lexer valid-parse)))))))
(let ((scan (make-buffer-mark (buffer syntax) 0 :left)))
(setf (offset scan) (end-offset (lexeme lexer (1- valid-parse))))
(skip-inter-lexeme-objects lexer scan)
(values 0 (offset scan))))))
;;; display
#+nil ; old, not based on stroking pumps.
......@@ -414,6 +414,8 @@ returns a symbol designating a paiprolog functor."
(define-command (com-export-paiprolog :name t :command-table prolog-table)
((pathname 'pathname))
(let ((expressions (view->paiprolog (current-view))))
(with-open-file (s pathname :direction :output :if-exists :supersede)
(dolist (e expressions)
(prin1 e s)))))
(let ((*package* (find-package :paiprolog)))
(with-open-file (s pathname :direction :output :if-exists :supersede)
(dolist (e expressions)
(prin1 e s)
(terpri s))))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment